linux安装nodejs


1.下载node.js

cd /usr/local/soft
wget https://nodejs.org/dist/v12.18.1/node-v12.18.1-linux-x64.tar.xz
tar xf node-v12.18.1-linux-x64.tar.xz
mv node-v12.18.1-linux-x64.tar.xz node

2.修改profile文件

[root@Dolen2021 soft]# cp /etc/profile /etc/profile20211215
[root@Dolen2021 soft]# vim /etc/profile
export PATH=$PATH:/usr/local/soft/node/bin [root@Dolen2021 soft]# source /etc/profile

3.查看node版本

[root@Dolen2021 soft]# node -v
v12.18.1

 4.完成