1. 程式人生 > >vscode 遇到的迷之bug nvm is not compatible with the npm config "prefix"

vscode 遇到的迷之bug nvm is not compatible with the npm config "prefix"

mac升級系統後,發現每次開啟vscode,在命令欄TERMINAL中都會出現不識別npm,把vscode重新安裝後,還是不行。 在這裡插入圖片描述

最後,在萬能的git上找到了解決方法,之前出錯的原因使因為我曾經使用brew install node安裝過node,而顯示是使用nvm安裝的node。只需要把之前的node刪除掉,就可以了。

rm -R /usr/local/lib/node_modules/npm
rm -R /usr/local/bin/npm /usr/local/lib/node_modules/npm/bin/npm-cli.js