Centos7+PostWoman完整无错版,解决es6编译失败问题 Linux

Cool.Cat 2020-03-25 1868

1、node -v查看版本,如果低于8的话先卸载再安装高版本,否则无法使用es6编译postwoman

yum remove nodejs -y


2、安装高版本node

cd /opt
wget https://npm.taobao.org/mirrors/node/v12.14.0/node-v12.14.0-linux-x64.tar.gz
tar zxvf node-v12.14.0-linux-x64.tar.gz


3、添加path并生效

vim /root/.bash_profile
export NODE_HOME="/opt/node-v12.14.0-linux-x64/bin"
export PATH=$NODE_HOME/bin:$PATH
source /root/.bash_profile


4、安装淘宝镜像

npm install -g cnpm --registry=https://registry.npm.taobao.org


5、下载postwoman项目并使用cnpm安装依赖及运行

cd /opt
git clone https://github.com/liyasthomas/postwoman.git
cnpm install
npm i node-sass -g
npm i core-js@2.6.5
npm run dev


最新回复 (0)
返回
发新帖
X