-
Notifications
You must be signed in to change notification settings - Fork 2.7k
yarn install not using auth token specified in .npmrc for a different url pointing to the same registry #5010
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
Comments
You need to set the developers server in .npmrc instead of the project directory. project directory has higher priority than the ~/.npmrc one. You're also going to run into the issue with #2566 |
@aikar Still, this is a good hint. I'll test again and check if the lockfile is what's causing the issue. Either way consider this a +1 for not locking the package url :) |
@MilosRasic oh I thought you meant the .npmrc was committed. If not then thats fine. But when developers add packages, its going to write the registry they used. Alternatively, you could update your CI Server to do a sed on the yarn.lock before running yarn install |
Hi, any progress on this? |
Same problem here! |
I might have had this problem where I got a 401 from the server even though my auth token was included in my .npmrc I added always auth true to it by running this command
It now works and fetches packages. |
for future reference: this is not a valid option anymore |
Do you want to request a feature or report a bug?
Reporting a bug
What is the current behavior?
We would like to have a private npm registry accessible on two different urls, one internal, not visible on the Internet, used in CI, and another one public, used by developers.
The CI instance user directory .npmrc looks something like:
Developers can use a .npmrc anywhere they want, usually in project directory, and it looks the same, using the same token, but has
registry=https://registry.build.myorgdomain.com/npm-virtual/
This works fine with npm 5, but when yarn install is ran, we get the following issue...
etc for all packages in package.json
The registry-private url has been added at a later date. Previously both CI and developers worked with the same url.
If the current behavior is a bug, please provide the steps to reproduce.
Not easy to reproduce. The required steps would be:
What is the expected behavior?
I would expect yarn to figure out both urls point to the same registry and use the same auth token.
Please mention your node.js, yarn and operating system version.
Tested with node 6.9.1 locally and 6.12.0 in CI.
yarn 1.3.2 both
linux both
The text was updated successfully, but these errors were encountered: