CentOS7 install NodeJS detailed tutorial (with installation steps)

1. Download nodejs compressed package

  • Official website download link: http://nodejs.cn/download/
    Insert picture description here
  • Download using the command line
wget https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x64.tar.xz

Insert picture description here

2. Unzip

tar -xvf node-v14.15.4-linux-x64.tar.xz
mkdir -p /usr/local/nodejs
mv node-v14.15.4-linux-x64/* /usr/local/nodejs/

3. Create a soft link

# 建立node软链接
ln -s /usr/local/nodejs/bin/node /usr/local/bin
# 建立npm 软链接
ln -s /usr/local/nodejs/bin/npm /usr/local/bin

4. Replace the mirror source

# 设置国内淘宝镜像源
npm config set registry https://registry.npm.taobao.org
# 查看设置信息
npm config list

Insert picture description here

5. Verify that the installation is successful

node -v
npm -v

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_37955704/article/details/113395046