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

yarn not respecting the local .npmrc if ~/.npmrc is present. #3411

Closed
sarbbottam opened this issue May 15, 2017 · 4 comments
Closed

yarn not respecting the local .npmrc if ~/.npmrc is present. #3411

sarbbottam opened this issue May 15, 2017 · 4 comments
Labels

Comments

@sarbbottam
Copy link

Do you want to request a feature or report a bug?

bug

What is the current behavior?
yarn in the presence of ~/.npmrc does not respect the ~/local/.npmrc.

If the current behavior is a bug, please provide the steps to reproduce.

This is to do with scoped internal packages.
You can only reproduce it if you are dealing with scoped internal (non-npm hosted packages).

  • create ~/.npmrc file with the following content.
    //registry.npmjs.org/
  • create ~/local/.npmrc file with the registry information for the scoped internal (non-npm hosted packages).
  • create package.json listing the scoped internal (non-npm hosted packages) as dependencies.
  • execute yarn
  • yarn errors out with error Couldn't find package "@organization/scoped-internal-package" on the "npm" registry.
  • yarn is still trying to look for the dependency at npm
  • however, if the ~/.npmrc is removed or renamed, yarn works as desired.
  • looks like while looking for .npmrc, yarn is giving higher precedence to the top most .npmrc. It should be the reverse. While looking for .npmrc yarn should look at the current directory .npmrc and traverse up if not found.

What is the expected behavior?
yarn should give the highest precedence to the local .npmrc file.

Please mention your node.js, yarn and operating system version.

  • OS - macOS Sierra 10.12.4
  • node - 7.9.0
  • yarn 0.24.4
@sarbbottam
Copy link
Author

Please note yarn does not respect the ~/local/.npmrc only if there is a ~/.npmrc.
If there is no ~/.npmrc, yarn works as expected.

@marian-r
Copy link

I can confirm that repository config works fine for me as also mentioned in #2193 (comment).

@bestander
Copy link
Member

duplicate of #2118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants