Last 12 weeks · 0 commits
4 of 6 standards met
Because registry-url adds trailing slashes to registry URLs, update-notifier (and anything else using registry-auth-token) doesn't currently work with some registry/auth URLs. Specifically, if the registry URL doesn't contain a trailing slash, like: @myscope:registry=https://contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/registry npm itself requires the following authToken line, due to its nerf-darting: //contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/:_authToken= But because registry-url appends a trailing slash, it makes the following registry url: @myscope:registry=https://contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/registry/ which (when using a library like registry-auth-token / matching npm's behavior) doesn't work with: //contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/:_authToken= and instead requires //contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/registry/:_authToken= Note that registry-auth-token had buggy behavior as well, and in 3.1.1 just took the fix https://github.com/rexxars/registry-auth-token/issues/10 to match npm's behavior. Was there a reason for adding the additional trailing slash? There must have been since I see tests for it, but it seems wrong to do and is causing this failure. Thanks.
due to the way this uses , this pkg will find a url specified in a user's file, but not necessarily the _global_ npmrc. the _global_ npmrc according to npm is located at where is determined based on where node is installed. for example, the docker container comes with a node install where the global config is expected to be at . if you're using , your npm will look for a file somewhere similar to . looking at how defines its logic, it will never look at , looking at instead. and thus if the registry url is defined in a global npmrc, this pkg will never find it.
Stumbled upon this possibly being needed by someone in the future while debugging: https://github.com/yarnpkg/yarn/issues/2935 can also be set in and if someone is using the workaround for the above and store it in instead of then this package may not pick that up. I haven't tested it yet though, just thought it might be helpful to have this issue here.
Repository: sindresorhus/registry-url. Description: Get the set npm registry URL Stars: 57, Forks: 19. Primary language: JavaScript. Languages: JavaScript (95.8%), TypeScript (4.2%). License: MIT. Latest release: v7.2.0 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 85%. Top contributors: sindresorhus, zanminkian, BendingBender, SamVerschueren, coreyfarrell, ENT8R, eush77, hutson, jasonk, kevva and others.