yarn error “EACCESS: permission denied, scandir '/home/ubuntu/.config/yarn/link'”

戏子无情 提交于 2020-04-07 18:09:03

问题


Whenever I try something with yarn on Ubuntu 16.04 server.

It gives an error.

I am currently using nodejs v8.10.0

yarn install v1.5.1
error An unexpected error occurred: "EACCES: permission denied, scandir '/home/ubuntu/.config/yarn/link'".
info If you think this is a bug, please open a bug report with the information provided in "/home/ubuntu/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Anyone know why this is happening?


回答1:


It's likely a unix permission related problem. There is a solution posted on the dev's github page. Try to run the following command

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config

Reference: EACCES: permission denied .config/configstore/bower-github.json #2262




回答2:


I had this problem as well, I found on another thread that my config folder was owned by root, which created several permissions issues.. I changed owner to my user and this error went away.

See top answer on this thread Unable to access 'git/attributes'




回答3:


If you are using macOS. Try to upgraded Yarn

brew upgrade yarn

ref Github



来源:https://stackoverflow.com/questions/49529696/yarn-error-eaccess-permission-denied-scandir-home-ubuntu-config-yarn-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!