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 ignores .npmrc settings file #2193

Closed
FDiskas opened this issue Dec 8, 2016 · 8 comments
Closed

Yarn ignores .npmrc settings file #2193

FDiskas opened this issue Dec 8, 2016 · 8 comments
Labels

Comments

@FDiskas
Copy link

FDiskas commented Dec 8, 2016

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

What is the current behavior?
It should respect npm settings https://docs.npmjs.com/files/npmrc

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

  1. create a new file .npmrc with content save-exact=true
  2. $ npm init -y
  3. yarn add jquery

What is the expected behavior?
It should install exact the latest version with no prefixs like ^

Please mention your node.js, yarn and operating system version.
Yarn version: v0.17.10
Node version: v7.2.0
NPM version: 3.10.9
SYSTEM: Kernel Version: 4.8.11-300.fc25.x86_64
Operating System: Fedora 25 (Workstation Edition)
OSType: linux
Architecture: x86_64

@FDiskas
Copy link
Author

FDiskas commented Dec 8, 2016

$ yarn config list
👾 shows that
info npm config { 'save-exact': true }

@SimenB
Copy link
Contributor

SimenB commented Dec 8, 2016

It respects npmrc registry, so the title is at least a little bit misleading 😄

@FDiskas
Copy link
Author

FDiskas commented Dec 8, 2016

Bad english :) worry

@gunnx
Copy link

gunnx commented Jan 14, 2017

I have a .npmrc in my USER folder with save-exact=true and when adding packages with yarn they are not saved in package.json as exact.

@kumarharsh
Copy link

kumarharsh commented Mar 30, 2017

It seems like Yarn is loading the configs in reverse order. I have a project-level .npmrc file which has:

save-exact = true
save-prefix = ''
loglevel = http

And when I run yarn config list, I get:

info yarn config
{ lastUpdateCheck: 1490785937703,
  'save-prefix': '^',                                                                                           
  'version-tag-prefix': 'v',                                                   
  'version-git-tag': true,                                                     
  'version-git-sign': false,                                                   
  'version-git-message': 'v%s',                                                
  'init-version': '1.0.0',                                                     
  'init-license': 'MIT',                                                       
  'ignore-scripts': false,                                                     
  'ignore-optional': false,                                                    
  'strict-ssl': true, }                    
info npm config                                                                
{ 'save-exact': true,                                                          
  'save-prefix': '',                                                           
  loglevel: 'http' } 

and when I do yarn config get save-prefix, I get ^ as the response.

Also, if I add a project-level .yarnrc file with:

save-exact ""

then yarn gives the correct value (empty string) for yarn config get save-prefix.

So, in essence, it seems like yarn is loading configs like so (lower priority first):

Npm Local
Yarn Global
Yarn Local

@FDiskas
Copy link
Author

FDiskas commented Apr 14, 2017

🔥 And this is still not fixed

@bestander
Copy link
Member

Yarn has its own settings in .yarnrc file https://yarnpkg.com/en/docs/yarnrc.
Yarn supports some of the .npmrc configs.
Help in documenting this is welcome

@alexilyaev
Copy link

alexilyaev commented Oct 1, 2017

Just to clarify regarding save-exact = true in .npmrc, from v1.1.0 Yarn respects it and does not add any prefix on yarn add package-name

Ref: #4471

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

6 participants