欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

npm: 权限阻止修复

发布时间:2025/7/14 编程问答 38 豆豆
生活随笔 收集整理的这篇文章主要介绍了 npm: 权限阻止修复 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

在使用 npm install 时,总提示:

Error: EACCES: permission denied

今天通过这个命令设置了权限解决了问题:

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

方法来自:https://stackoverflow.com/a/51923345/1185971

---

在安装 node-gyp 时提示:

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/baidu/.npm/_cacache/tmp'

npm ERR! cb() never called!

采用上文方法处理后,又提示:

Error: EACCES: permission denied, access '/usr/local/lib/node_modules'

于是,又执行了一个:

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

解决~

转载于:https://www.cnblogs.com/duxing/p/10521743.html

总结

以上是生活随笔为你收集整理的npm: 权限阻止修复的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。