Linux:安装nodejs


yum安装

自带版本

yum install nodejs

但是版本很低【6.17.1】

高版本

参考:链接

1、删除旧版本

yum remove nodejs

2、添加Node.js Yum存储库  

最新发布:
yum clean all && yum makecache fast
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -

稳定发布:
yum clean all && yum makecache fast
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -

3、安装

yum install nodejs

4、验证

node -v

npm -v

Yarn安装  

参考:链接