当前位置:网站首页>Failed to execute NPM instruction, prompting ssh: Permission denied

Failed to execute NPM instruction, prompting ssh: Permission denied

2022-06-27 12:40:00 LK mountain man under the moon

problem : Console input npm Failed in correlation instruction , Tips
ssh: /usr/…/node_modules/… Permission denied
reason : The problem of relying on packages
Solution :
1) Refactoring dependencies Or download the dependency again
2) Add permissions

1 Refactoring dependencies

The refactoring method for dependencies is simple , Enter directly in the code warehouse directory npm rebuild , And then you can go ahead and npm Relevant instructions

npm rebuild

2 Add permissions

adopt chown Change the owner of the specified file to the specified user ,
-R Means to process all files in the specified directory and its subdirectories ,
whoami Indicates your own user name ,
The last item indicates the file directory that needs authorization

sudo chown -R $(whoami) /usr/local/lib
sudo chown -R $(whoami) /usr/local/bin
原网站

版权声明
本文为[LK mountain man under the moon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206271208006060.html