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

解決~


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM