CentOS 通过yum安装nodejs和npm 1、获取nodejs 资源

1、获取nodejs 资源

# 4.x

curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -

# 5.x

curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -



2、安装

yum install -y nodejs



测试是否安装成功

node -v 

 # v4.4.0

npm -v

# 2.14.20


npm的另一种安装方式是

[html]  view plain  copy
  1. wget http://npmjs.org/install.sh    
  2. chmod +x ./install.sh    
  3. ./install.sh    

猜你喜欢

转载自blog.csdn.net/qnzhangqing/article/details/80237033