部署vue3+drango

前端:

D:

cd D:\Project\django-vue-admin\web

npm install yarn
yarn install --registry=https://registry.npmmirror.com

报错

yarn config set ignore-engines true

yarn build

报错:These dependencies were not found:

 

c盘:
npm install -g yarn

yarn install --registry=https://registry.npmmirror.com

d盘:
cd D:\Project\django-vue-admin\web
yarn build

问题:yarn构建成功,localhost拒绝访问

看到Done以为启动成功,但这只是dist目录准备好部署

但localhost拒绝访问,原因http未启动

报错如下:

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

495ae775a0de408ca3041dad9d8832f1.png

接着我们点击链接获取解决方法: 

ef09677ebcce48c9a8dcea49554a733a.png

解决

方法1

#官网解决办法
npm install -g serve
# -s flag means serve it in Single-Page Application mode
# which deals with the routing problem below
serve -s dist

方法2

npm install http-server -g

再切换至dist目录,运行:

http-server

如图构建成功 

e8af3129f13242c5ae759ac2f5f7e880.png

注:这里参照了 DONE Build complete. The dist directory is ready to be deployed.-CSDN博客的方法

 

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值