Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn EACCES: permission denied

I have a workspace setup and ever sense I keep getting permission issues with yarn:

error An unexpected error occurred: "EACCES: permission denied, mkdir '/home/code/client/node_modules/cacache/node_modules/mkdirp'".

The only solution I have is to delete node_modules on all packages which are part of my workspace, which gets annoying.

Then I run yarn install again and everything is fine. Next day I'll come back and face the same issue.

I also have to use sudo to delete node_modules which is strange.

like image 797
Batman Avatar asked Nov 15 '25 23:11

Batman


1 Answers

You can set permission by

sudo chown -R $USER:$GROUP node_modules

or

sudo chmod -R u+w /your/project/directory

or

sudo chmod -R 777 /your/project/directory
like image 133
Jaber Al Nahian Avatar answered Nov 17 '25 13:11

Jaber Al Nahian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!