彻底卸载nodejs和npm然后使用nvm
生活随笔
收集整理的這篇文章主要介紹了
彻底卸载nodejs和npm然后使用nvm
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
sudo apt-get remove --purge npm
sudo apt-get remove --purge nodejs
sudo apt-get remove --purge nodejs-legacy
sudo apt-get autoremove(這個不要輕易運行)
?
#手動刪除 npm 相關目錄
rm -r /usr/local/bin/npm
rm -r /usr/local/lib/node-modules
rm -r /tmp/npm*
rm -r /usr/local/n
rm -r /usr/local/lib/node_modules
git clone?https://gitee.com/mirrors/nvm.git
./install.sh
另外開個終端就可以使用nvm了。
nvm install v12.18.0
安裝后效果如下:
(Python3.6) appleyuchi@Desktop:flink$ which node
/home/appleyuchi/.nvm/versions/node/v12.18.0/bin/node
(Python3.6) appleyuchi@Desktop:flink$ which npm
/home/appleyuchi/.nvm/versions/node/v12.18.0/bin/npm
nvm ls-remote(列出可以安裝的版本號)
npm init
npm install express --registry https://registry.npm.taobao.org
查看當前的源是不是淘寶:
npm config get registry
npm install -g @angular/cli(這里必須全局)
?
?
如果卸載angular-cli如下:
nvm use v12.18.0 npm uninstall -g angular-cli npm uninstall -g @angular/cli npm cache clean npm install -g @angular/cli@latest總結
以上是生活随笔為你收集整理的彻底卸载nodejs和npm然后使用nvm的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ng build command not
- 下一篇: 天龙八部手游帮会宴请得多少帮贡