刚从远程clone下来的代码,npm run dev后报错,报错信息如下:

 ERROR  Invalid options in vue.config.js: "publicPath" is not allowed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iview-admin@2.0.0 dev: `vue-cli-service serve --open`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the iview-admin@2.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/thinker/.npm/_logs/2019-10-11T03_32_39_690Z-debug.log

在这里插入图片描述

解决方式:
具体原因是因为版本支持的问题,publicPath 属性到 vue-cli 3.2.0 之后才支持,所以将 publicPath 改成 baseUrl 即可,或者升级你的 vue-cli 。

修改前:
在这里插入图片描述
修改后:
在这里插入图片描述

Logo

前往低代码交流专区

更多推荐