1. 下载

wget https://npm.taobao.org/mirrors/node/v10.8.0/node-v10.8.0-linux-x64.tar.gz

 

2. 解压

tar -zxvf node-v10.8.0-linux-x64.tar.gz

 

3.设置环境变量

vim /etc/profile

export PATH=$PATH:/root/node-v10.8.0-linux-x64/bin

source /etc/profile

 

4. 安装cnpm 

由于NMP源都在国外,下载相关资源很慢,所以建议用国内的淘宝NPM镜像(http://npm.taobao.org/)

  通过cnmp命令安装的包都会从淘宝NMP下载,速度很快。  

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

cnpm install

cd  项目中

npm  run   build-{{项目}}

 

编译结果

[root@localhost hip-frontend]# ls
build  config  dist  favicon.ico  node_modules  package.json  README.md  src  static  test

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-12-23
  • 2021-06-28
  • 2021-06-02
  • 2021-11-11
猜你喜欢
  • 2021-09-06
  • 2021-07-12
相关资源
相似解决方案