-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I have something like the following in my ~/.npmrc file:
@mycompany:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
This is necessary so I can login to my private repo and get the packages I need to build locally.
When I add a new package like @mycompany/foo I would expect an entry in the yarn.lock
file to look something like this:
"@mycompany/foo@^1.1.0":
version "1.1.0"
resolved "https://registry.npmjs.org/@mycompany/foo/-/foo-1.1.0.tgz#103034ba565c288eb781b1fd1065c9f05dfb90f9"
Yeah... not so much. Instead it looks like this:
"@mycompany/foo@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@mycompany/foo/-/foo-1.1.0.tgz#103034ba565c288eb781b1fd1065c9f05dfb90f9"
Uncool yarn. This causes my CI to break because it will try and dig up the packages at registry.yarnpkg.com
. Since this is a private registry the login will fail (since the registry is hosted on registry.npmjs.org) and thus it will cause other systems to fail to install packages.
Here is how to reproduce:
- Setup a private repo on npm with some namespace
- Set your .npmrc file to something like the one I provided above (except you replace the scope
mycompany
with your own scope, and set a valid auth token of course), and runyarn add <your scoped package>
. You can do this by doingnpm login --registry=https://registry.npmjs.org --scope=@<your scope name>
. I would use yarn login but that doesn't work :( - Add a package from your scope using
yarn add
- Push a trivial update to that package in your scope.
- Tell yarn to upgrade the package.
You will see that the URL gets changed in the lock file.
Please mention your node.js, yarn and operating system version.
node: 8.2.1
yarn: 0.28.4
OS: Fedora 26