Permission denied when installing npm module

杀马特。学长 韩版系。学妹 提交于 2019-11-28 21:28:05

You need to reclaim ownership of the .npm directory.

sudo chown -R $(whoami) ~/.npm

and need the write permission in node_modules directory:

sudo chown -R $(whoami) /usr/lib/node_modules

A rule of thumb as I have learned is to never run npm install with sudo. That creates items with root being the owner as opposed to your username.

Give full permission to node modules folder

command

sudo chmod 777 -R node_modules/

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