Mac上npm更新失败且无法使用的解决方法

更新npm的时候出现了好多error,之后在终端输入npm -v直接command not found

在访达中使用快捷键command+shift+G,进入/usr/local/lib/node_modules/,发现里面没有npm的文件夹

直接重装,在终端输入

curl -L https://npmjs.com/install.sh| sh

安装完成后输入npm -v查看是否安装成功

npm -v

若想要卸载npm,可以在终端输入

sudo npm uninstall npm -g

若无法卸载还可尝试以下方法

cd /usr/local/lib/node_modules/npm/
sudo make uninstall

 

 



 

你可能感兴趣的:(Mac,npm,mac)