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.37k stars 2.72k forks source link

Yarn install doesn't seem to respect cache=<path> set in .npmrc #8932

Open jamie-harness opened 1 year ago

jamie-harness commented 1 year ago

I have tried to add lines cache=/root/yarn as an absolute path, or cache=./yarn or cache=yarnas a relative path to the .npmrc file in the project. But when I run yarn the folder is not populated.

But if I do yarn config set cache-folder /root/yarn The folder is properly populated

I read it here that it should be respected: https://classic.yarnpkg.com/en/docs/cli/cache#toc-change-the-cache-path-for-yarn

One example that can be tried is the react repo: https://github.com/facebook/react I added the .npmrc file in the root folder and added the lines above

Please let me know if I'm doing something wrong here. Thank you

My environment information is below

node- 14.19.0
yarn- 1.22.19
npm- 6.14.16