1.安装node、npm、cnpm

apt install nodejs
y
apt install npm
y
node -v
npm -v

部署(6.前端项目)

 

 

npm install cnpm -g --registry=HTTPS://registry.npm.taobao.org;
cnpm -v

 

2.安装依赖

cd demo
cnpm install

3.将路由模式改成history模式:

部署(6.前端项目)

 

 

部署(6.前端项目)

 

 

vim src/router/index.js

4.打包

部署(6.前端项目)

npm run build

5.配置Nginx

#加入配置
server{
  listen 80;
  server_name 49.234.49.146;
  location / {
    root /home/ubuntu/demo/dist;
    index index.html;
  }
}

部署(6.前端项目)

相关文章:

  • 2021-05-29
  • 2022-01-20
  • 2021-12-07
  • 2021-11-23
  • 2021-10-13
  • 2021-10-26
  • 2021-11-02
  • 2022-01-10
猜你喜欢
  • 2021-09-24
  • 2021-10-22
  • 2021-11-26
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案