You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit your local .npmrc file to have auth tokens in e.g.
; Treat this auth token like a password. Do not share it with anyone, including Microsoft support. This token expires on or before 12/11/2017.
; begin auth token
//companyname.pkgs.visualstudio.com/_packaging/FeedName/npm/registry/:_authToken=ey...
//companyname.pkgs.visualstudio.com/_packaging/FeedName/npm/:_authToken=ey...
; end auth token
N.B. trailing slash in auth token path.
yarn install
See 401 errors:
[1/4] Resolving packages...
verbose 1.275 Performing "GET" request to "https://companyname.pkgs.visualstudio.com/_packaging/FeedName/npm/body-parser".
verbose 1.465 Request "https://companyname.pkgs.visualstudio.com/_packaging/FeedName/npm/body-parser" finished with status code 401.
verbose 1.466 Error: Couldn't find package "body-parser" on the "npm" registry.
at C:\Program Files (x86)\Yarn\lib\cli.js:48169:15
at Generator.next (<anonymous>)
at step (C:\Program Files (x86)\Yarn\lib\cli.js:92:30)
at C:\Program Files (x86)\Yarn\lib\cli.js:103:13
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
error Couldn't find package "body-parser" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
A fix is to make sure that the registry path matches exactly the path of the auth token. In this instance, it just needs a trailing slash.
Interestingly, if the auth token doesn't have the trailing slash, but the registry does, this works fine. Almost as if it's a non-commutative equality!!
This works fine either way with npm install. If I had to guess, I'd say it's trimming (or adding) trailing /'s on the URL on the registry, but not the authtoken.
The text was updated successfully, but these errors were encountered:
Yarn v1.0.1 on Win10-1703 x64, also Yarn v1.0.1 on macOS 10.12.16.
My feed is a VSTS npm feed, but I imagine this happens with other private feeds too.
.npmrc
file in it with.npmrc
file to have auth tokens in e.g.N.B. trailing slash in auth token path.
yarn install
See 401 errors:
A fix is to make sure that the
registry
path matches exactly the path of the auth token. In this instance, it just needs a trailing slash.Interestingly, if the auth token doesn't have the trailing slash, but the registry does, this works fine. Almost as if it's a non-commutative equality!!
This works fine either way with
npm install
. If I had to guess, I'd say it's trimming (or adding) trailing /'s on the URL on the registry, but not the authtoken.The text was updated successfully, but these errors were encountered: