前言: 咱们日常经常使用的安装软件有三种方式, yum(apt-get等)命令, rpm(deb等)包, 源码编译, 而最便捷的即是yum式的命令式安装, 下面, 咱们就以最便捷的方式来安装它node
curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
其余版本, 如:npm
curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
sudo yum install -y nodejs
node --version npm --version
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
其余版本, 如:ubuntu
curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
sudo apt-get install -y nodejs
node --version npm --version
请到网站去找centos
https://rpm.nodesource.com
note: 记得用
root
权限bash