yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.45k stars 2.73k forks source link

How to have yarn dependencies from different registries for different packages in the package.json? #8781

Open AnirudhNv opened 2 years ago

AnirudhNv commented 2 years ago

I have two registries under consideration . registry one: https://npm.example.com/ registry registry two: https://npm.client.com/

So most of dependencies are installed from the first registry. But for one dependency Eg: icons , this should be picked from another URL.

In my package.json

"dependencies": {
"@angular/animations": "11.2.14",
"@angular/cdk": "11.2.13",
// and so on

"icons-library":"1.0.0" 
}

So here only for icons-library i need it to look for another registry URL. ie https://npm.client.com/

I have tried

yarn install
yarn config set icons-library https://npm.client.com
yarn install

But this doesn't seem to be working.

Any corrections or recommendations are welcome. TIA

jyeric commented 2 years ago

same question meets

jyeric commented 2 years ago

I have two registries under consideration . registry one: https://npm.example.com/ registry registry two: https://npm.client.com/

So most of dependencies are installed from the first registry. But for one dependency Eg: icons , this should be picked from another URL.

In my package.json

"dependencies": {
"@angular/animations": "11.2.14",
"@angular/cdk": "11.2.13",
// and so on

"icons-library":"1.0.0" 
}

So here only for icons-library i need it to look for another registry URL. ie https://npm.client.com/

I have tried

yarn install
yarn config set icons-library https://npm.client.com
yarn install

But this doesn't seem to be working.

Any corrections or recommendations are welcome. TIA

I solved it by modifying/deleting yarn.lock file.

reference: #4862