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.4k stars 2.73k forks source link

Yarn is not working - EROFS: read-only file system, mkdir '/cache' #8952

Open robbybenta opened 1 year ago

robbybenta commented 1 year ago

i am facing the error Yarn is not working - EROFS: read-only file system, mkdir '/cache'. with node version v18.16.0 , npm version 9.5.1 , and yarn version 1.22.19

iamabdulhaseeb commented 1 year ago

@robbybenta were you able to solve this?

iamabdulhaseeb commented 1 year ago

I solved it by running this in terminal

export YARN_CACHE_FOLDER=~/.yarn/cache

export YARN_GLOBAL_FOLDER=~/.yarn/global

These commands set the YARN_CACHE_FOLDER to ~/.yarn/cache and the YARN_GLOBAL_FOLDER to ~/.yarn/global. You can adjust the paths if you prefer different locations.