在Linux上安装node.js环境

2018-10-15  本文已影响0人  沈哲培

在Linux上安装node.js环境

Install git wget vim

yum install -y epel-release
yum install wget git vim -y

Install nodejs

wget http://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.gz
mkdir -p /usr/local/nodejs/nodejs-v8.12.0
tar --strip-components 1 -xzvf node-v* -C /usr/local/nodejs/nodejs-v8.12.0

Config ENV

install vim before better

vim /etc/profile

please use source /etc/profile after change env

export NODE_HOME=/usr/local/nodejs/nodejs-v8.12.0
export PATH=$PATH:${NODE_HOME}/bin

Test node.js

node -v
npm -v

Install yarn

wget https://github.com/yarnpkg/yarn/releases/download/v1.7.0/yarn-v1.7.0.tar.gz
mkdir -p /usr/local/yarn
tar -zxvf yarn-v1.7.0.tar.gz -C /usr/local/yarn

Config ENV

install vim before better

vim /etc/profile

please use source /etc/profile after change env

export PATH=$PATH:/usr/local/yarn/yarn-v1.7.0/bin

Test yarn

yarn -v

SET Intranet NPM

please install git before

npm config set @yylc:registry http://nexus.yingyingwork.com/repository/npm-hosted/
上一篇 下一篇

猜你喜欢

热点阅读