Failed to load resource: the server responded with a status of 404 (Not Found)

问题描述:

用 npm run serve 打包时,出现了下边这种报错信息
Failed to load resource: the server responded with a status of 404 (Not Found)_第1张图片

解决办法

报错大致内容是:
无法加载资源:服务器响应状态为404(未找到),出现了该错误后,可以打开项目根目录下的vue.config.js文件,然后将

publicPath: '/',

改为

publicPath: './',

然后再重新build即可

你可能感兴趣的:(vue,vue.js,npm,node.js)