0

I'm trying to push to a repository configured as an npm project. I followed the quickstart tutorial without problem. Now I'm trying to actually push an npm project, but I'm running into a problem.

I already ran the following commands:

  • gcloud config set artifacts/repository <repository name>
  • gcloud config set artifacts/location <region>

Now, I'm trying to find out the scope I need to use, so I ran the following command (suggested by the tutorial, Gemini, and this README):

gcloud artifacts print-settings npm

It fails with the following message:

(gcloud.artifacts.print-settings.npm) NOT_FOUND: Requested entity was not found.

I can see that, in my CLI, the project is correct, and when I did followed the quickstart, the repo was correctly created.

Why is this happening, and how can I solve this problem?

1
  • 1
    I am looking forward to your feedback to understand whether the provided resolution has helped you in resolving the issue. If not, I am happy to assist further Commented Apr 30, 2024 at 13:15

1 Answer 1

1

I tried to reproduce by following the same tutorial that you shared I’m able to run the command gcloud artifacts print-settings npm without errors and got the output, maybe you can try the below steps

1.Update the Google Cloud SDK and components. As suggested here

Windows:

  • Open an elevated Windows Command Prompt.
  • Execute this command and follow the prompts: gcloud components update

Linux:

  • Execute this command and follow the prompts: sudo gcloud components update

2.check the service account email you are using,also check if you have necessary permissions like Artifact Registry Administratorto access the repository check this document Predefined Artifact Registry roles for more information.

3.Make sure you're using the correct repository name when setting the configuration.

  1. Also view a list of supported repository locations, by running the following command:
gcloud artifacts locations list

Or, Check this document to view the Available regions

5.Try recreating the repository.

If you're still encountering issues even after above steps, you may try reaching out to Google Cloud support for further assistance or raise a issue tracker

Sign up to request clarification or add additional context in comments.

4 Comments

hi! I'm sorry I couldn't get back to this earlier. I re-did the tutorial and everything worked, including the line gcloud artifacts print-settings npm. Afterwards, I tried to use a scope to deploy, but it didnt't work. I ended up having to use the @quickstart scope to deploy, and then it worked. I don't really understand how that works. What's the proper way to create a scope?
As mentioned in the tutorial, The quickstart scope is associated with your repository. When you include the scope in commands to publish or install packages, npm uses your repository. When you publish or install packages without a scope, your configured default repository is used.
So, to create a scope, can I simply prepend it to a package, or do I need to do something else before? I tried to add something else instead of quickstart, but the command failed
yes, you can add it before the package, I tried with a different scope it is working for me, what is the error message you are getting?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.