[英]Mac error: /bin/sh: npm: command not found
我正在嘗試構建 c++ 項目並看到以下錯誤:請看一下?
/bin/sh: npm: command not found
make[2]: *** [modules/GUI/CMakeFiles/Client] Error 127
make[1]: *** [modules/GUI/CMakeFiles/Client.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
我關注了這個wiki: sudo:npm:找不到命令但這對我不起作用。
For MAC users, the follow steps worked for me, the error still there.
$ brew update
$ brew uninstall node
$ brew install node
$ brew postinstall
你看到這個了嗎?
您是否嘗試過: brew doctor
?
當你這樣做時,你會得到什么:
which node
which npm
如果你得到node
的任何東西,請尋找路徑並查看附近有什么。
最壞的情況,如果您沒有向brew
添加任何其他內容,請考慮刪除brew
並重新安裝。
僅供參考:對我來說,使用 nvm,我看到了這個:
➜ ~ which npm
/Users/pgkehle/.nvm/versions/node/v11.15.0/bin/npm
➜ ~ which node
/Users/pgkehle/.nvm/versions/node/v11.15.0/bin/node
您的路徑會有所不同,但可以考慮nvm
作為替代方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.