彻底卸载nodejs和npm然后使用nvm | 您所在的位置:网站首页 › 怎么完全删除nodejs › 彻底卸载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/npmnvm 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 |
CopyRight 2018-2019 实验室设备网 版权所有 |