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] npm access commands not sending auth token #6210

Closed
2 tasks done
DavidTanner opened this issue Feb 28, 2023 · 0 comments · Fixed by #6211
Closed
2 tasks done

[BUG] npm access commands not sending auth token #6210

DavidTanner opened this issue Feb 28, 2023 · 0 comments · Fixed by #6211
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release

Comments

@DavidTanner
Copy link
Contributor

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

After having set both the NPM_TOKEN environment variable, and running echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc, the npm access grant command fails with Unable to authenticate, need: bearer.

Issue appears to have been introduced by this commit.

Other commands work by sending ...this.npm.flatOptions, and this appears to be missing from the access commands.

Expected Behavior

The command should update the package with permissions for my team.

Steps To Reproduce

export NPM_TOKEN=''
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm access grant read-only ORG:GROUP '@ORG/PACKAGE'

Environment

  • npm: v9.5.1
  • Node.js: v18.14.1
  • OS Name: Linux 5.15.0-1033-azure
  • System Model Name: Ubuntu 22.04.2
  • npm config:
Run npm config ls
; "project" config from /home/runner/work/terminology-change-stream/terminology-change-stream/.npmrc

//registry.npmjs.org/:_authToken = (protected) 

; node bin location = /opt/hostedtoolcache/node/18.14.1/x64/bin/node
; node version = v18.14.1
; npm local prefix = /home/runner/work/terminology-change-stream/terminology-change-stream
; npm version = 9.5.1
; cwd = /home/runner/work/terminology-change-stream/terminology-change-stream
; HOME = /home/runner
; Run `npm config ls -l` to show all defaults.
@DavidTanner DavidTanner added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Feb 28, 2023
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 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant