说明
按照官方(www.npmjs.com)的说法,npm与Node.js一起存在,这意味着当您下载并安装Node.js时,您会自动在计算机上安装npm。所以这里我们只需要安装Node.js即可。其实之前发过这样的教程,只是没有写Centos系统,所以这里又拿出来说一次,包括Centos系统,目前最新的Node.js版本为10.x这里说下安装方法。
安装
Node.js官方GitHub地址:https://github.com/nodesource/distributions
Ubuntu系统
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejsDebian系统
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejsCentos系统
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
yum install nodejs -y检查Node.js和NPM版本
node -v
npm -v 
