# CentOS7下配置Node
# 介绍
[TOC]
安装环境:
system:CentOS7
node:node-v10.16.3-linux-x64
# Node安装
# 方法一
解压压缩包
tar -xvf node-v10.16.3-linux-x64.tar.xz
1建立软连接
ln -s /app/node-v10.16.3-linux-x64/bin/npm /usr/local/bin/ ln -s /app/node-v10.16.3-linux-x64/bin/node /usr/local/bin/
1
2
3
# 方法二
下载安装包
curl: curl https://raw.github.com/creationix/nvm/master/install.sh | sh wget: wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh
1
2
3
4
5
6
7安装node
nvm install stable
1
# 方法三
下载安装包
curl: curl -sL https://rpm.nodesource.com/setup_10.x | bash -
1
2
3安装node
yum install -y nodejs
1
# NPM配置镜像
npm配置淘宝镜像
npm config set registry https://registry.npm.taobao.org
1查看镜像配置信息
npm config get registry
1还原npm仓库地址
npm config set registry https://registry.npmjs.org/
1