Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG/Question] code ENEEDAUTH issue #5805

Closed
2 tasks done
VividLemon opened this issue Nov 3, 2022 · 6 comments
Closed
2 tasks done

[BUG/Question] code ENEEDAUTH issue #5805

VividLemon opened this issue Nov 3, 2022 · 6 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@VividLemon
Copy link

VividLemon commented Nov 3, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

In my current ci I have the action running:

      - name: Publish 
        run: npm publish --tag latest --filter bootstrap-vue-3 --access=public
        env:
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

Without any changes, it now always fails with npm ERR! code ENEEDAUTH

This entire issue could be solved by answering a simple question, does npm fail with this code when a token has expired? Nothing that I have here has changed, and has been working smoothly for months. But, I don't have access to the token. I have explored this old post #3618 that didn't seem to get any replies. Is the error just too ambiguous and should instead maybe state that it's forbidden? Assuming that is the issue.

Expected Behavior

Not to fail

Steps To Reproduce

N/a

Environment

This is ran through a github action running node 16, and npm v8.

@VividLemon VividLemon added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Nov 3, 2022
@vighnesh153
Copy link

vighnesh153 commented Feb 17, 2023

Did you find a workaround for this?

@caugner
Copy link

caugner commented May 11, 2023

@VividLemon Most likely you need to explicitly set the registry-url on the setup-node action, like this:

       - name: Setup Node.js
         uses: actions/setup-node@v3
         with:
+          registry-url: "https://registry.npmjs.org"

See also #6184 (comment) for details.

@VividLemon
Copy link
Author

@VividLemon Most likely you need to explicitly set the registry-url on the setup-node action, like this:

       - name: Setup Node.js
         uses: actions/setup-node@v3
         with:
+          registry-url: "https://registry.npmjs.org"

See also #6184 (comment) for details.

I had forgotten I made this issue! Yes, this was the problem

@VividLemon
Copy link
Author

But as a side note, perhaps the error message could be more descriptive

@caugner
Copy link

caugner commented May 11, 2023

But as a side note, perhaps the error message could be more descriptive

You're right, the error message could mention the .npmrc file, and even detect that it's running as part of CI, so it could mention how to reference environment variables in it, or point to the docs.

@caugner
Copy link

caugner commented May 11, 2023

(@VividLemon But I guess you can close the issue?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

3 participants