安装node
sudo apt-get install nodejs
sudo apt-get install nodejs-legacy
安装最新的 node v10.x
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash
sudo apt-get install -y nodejs
安装npm
sudo apt install npm
升级到最新的 npm
sudo npm install npm@latest -g
非root用户操作失败的话,可以尝试使用 SUDO’,
首发: [zhanghaoran.ren]https://blog.zhanghaoran.ren/article/html/ubuntuXiaAnZhuangXieZaiZuiXinBanNode&NPM.html)
卸载node,npm
#apt-get 卸载
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-moudels
find / -name npm
rm -r /tmp/npm*
本文来自于简书:Ubuntu 卸载安装 node 和 npm,
本人实践过后首发到zhanghaoran.ren
最后
以上就是激情鼠标最近收集整理的关于Ubuntu安装/卸载node,npm的全部内容,更多相关Ubuntu安装/卸载node内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复