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

Extract loadConfig from YarnRegistry/NpmRegistry responsibility (reading .npmrc/.yarnrc configs) #3683

Closed
bestander opened this issue Jun 20, 2017 · 5 comments

Comments

@bestander
Copy link
Member

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

YarnRegistry extends NpmRegistry.
YarnRegistry reads .yarnrc into config object and NpmRegistry reads .npmrc into config object.

In some cases YarnRegistry is used for requests in other NpmRegistry.
This makes it confusing to track down when settings are used from .npmrc and when from .yarnrc and this causes issues like #3612

@bestander bestander changed the title Extract loadConfig from YarnRegistry/NpmRegistry responsibility Extract loadConfig from YarnRegistry/NpmRegistry responsibility (reading .npmrc/.yarnrc configs) Jun 21, 2017
@bestander
Copy link
Member Author

BTW if you want to make Yarn work better with .npmrc speak up and send a PR.

@MaxCCC
Copy link

MaxCCC commented Sep 14, 2017

@bestander I have defined the following .npmrc and .yarnrc:


proxy=http://prox
https-proxy=https://prox
registry=http://xxx:8081/artifactory/api/npm/npm
strict-ssl=false
maxsockets=xxx

and

registry "http://xxx:8081/artifactory/api/npm/npm"
"_auth" xxx
always-auth false
email [email protected]
strict-ssl false
maxsockets "xxx"

I've deleted our node_modules and yarn.lock

Now when we the yarn install is executed:

[INFO] [1/4] Resolving packages...
verbose: GET request to http://xxx:8081/artifactory/api/npm/npm
[INFO] [2/4] Fetching packages... (fail)
verbose: Performing "GET" request to "https://xxx/artifactory/api/npm/npm/xxx.tgz".

Why is it resolving to https during the fetch? We want to keep everything on http. Everything is internal.
yarn config list just before the install shows only the right http url's.

@yyjazsf
Copy link

yyjazsf commented Nov 29, 2019

I think: when use yarn
project's .yarnrc > project's .npmrc > global .yarnrc > global .npmrc

@yyjazsf
Copy link

yyjazsf commented Nov 29, 2019

This is also worth considering.
yarn only use .yarnc.
npm only use .npmrc
if someone use yarn, they should use yarn's file. It's no friendly

@paul-soporan
Copy link
Member

Closing as in v2 we've decided to only read .yarnrc.yml files.

https://yarnpkg.com/getting-started/migration

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

No branches or pull requests

4 participants