如何解决centos的nodejs-npm版本的升级

1次阅读

共计 209 个字符,预计需要花费 1 分钟才能阅读完成。

删除 node

yum remove nodejs

删除 yum 源

cd 到 yum 源配置文件夹:cd /etc/yum.repo.d,删除以 node 开头的源;
清除 yum 缓存 yum clean all

安装 node

curl -sL https://rpm.nodesource.com/setup_10.x | bash -

yum install -y nodejs

更新 npm

npm install npm@latest -g
命令:npm -v 输出版本号就成功安装了。

正文完
 0