[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# wget https://nodejs.org/download/release/v8.11.1/node-v8.11.1-linux-x64.tar.gz
[[email protected] src]# tar xf node-v8.11.1-linux-x64.tar.gz
[[email protected] src]# cd node-v8.11.1-linux-x64/bin
[[email protected] bin]# ./node -v
v8.11.1
然后添加环境变量
[[email protected] bin]# vim /etc/profile
###########################################
export NODE_HOME=/usr/local/src/node-v8.11.1-linux-x64/
export PATH=$NODE_HOME/bin:$PATH
#################################
[[email protected] bin]# source /etc/profile
[[email protected] bin]# node -v
v8.11.1
生成添加gitlab**
[[email protected] work]# ssh-****** -t rsa -C [email protected]
[[email protected] work]# vim /root/.ssh/id_rsa.pub
[[email protected] work]# git clone [email protected]:eatjoys-front/eatjoys-front-min.git
或者指定分支
git clone -b develop [email protected]:eatjoys-front/eatjoys-front-min.git
全局安装yarn
npm config set registry https://registry.npm.taobao.org/
npm install yarn -g //只下载一次
npm install //只下载一次
[[email protected] work]# npm install yarn -g
/usr/local/src/node-v8.11.1-linux-x64/bin/yarn -> /usr/local/src/node-v8.11.1-linux-x64/lib/node_modules/yarn/bin/yarn.js
/usr/local/src/node-v8.11.1-linux-x64/bin/yarnpkg -> /usr/local/src/node-v8.11.1-linux-x64/lib/node_modules/yarn/bin/yarn.js
+ [email protected]
added 1 package in 2.051s
[[email protected] eatjoys-front-min]# npm config set registry https://registry.npm.taobao.org/
[[email protected] eatjoys-front-min]# npm install
[[email protected] eatjoys-front-min]# yarn
[[email protected] eatjoys-front-min]# npm run build
然后dist目录就是打好的包了