🥝FANMR.CN热爱,追求
CentOS安装Node

下载Node

官方下载地址下载.tar.xz结尾的安装文件

可以通过wget获取下载后上传到服务器的方式

解压

tar -xvf node-xxxx.tar.xz

配置

编辑/etc/profile,加上解压后node的路径

export PATH=$PATH:/usr/local/nodejs/bin

立即生效

使用命令source /etc/profile

然后就可以使用node -vnpm -v查看到安装的Node版本