我正在使用@vue/cli v3.7.0
,通过vue create myapp
创建了一个带有Babel + Router + node-sass的项目,并且我的项目已经成功安装
但是当我在项目目录中运行npm run serve时,我遇到了以下错误:
INFO Starting development server...
ERROR ValidationError: webpack Dev Server Invalid Options
options.clientLogLevel should be {String} and equal to one of the allowed values
[ 'info', 'warn', 'error', 'debug', 'trace', 'silent' ]
(https://webpack.js.org/configuration/dev-server/#devserverclientloglevel)
ValidationError: webpack Dev Server Invalid Options
options.clientLogLevel should be {String} and equal to one of the allowed values
[ 'info', 'warn', 'error', 'debug', 'trace', 'silent' ]
(https://webpack.js.org/configuration/dev-server/#devserverclientloglevel)
at validateOptions (C:\Users\Dell\Desktop\myapp\node_modules\webpack-dev-server\node_modules\schema-utils\src\validateOptions.js:32:11)
at new Server (C:\Users\Dell\Desktop\myapp\node_modules\webpack-dev-server\lib\Server.js:71:5)
at serve (C:\Users\Dell\Desktop\myapp\node_modules\@vue\cli-service\lib\commands\serve.js:138:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myapp@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp@0.1.0 serve 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! C:\Users\Dell\AppData\Roaming\npm-cache\_logs\2019-05-17T19_40_14_984Z-debug.log
我尝试了npm cache clean -f
,重新安装VueJS,重新创建项目,但都没有起作用 :(
我希望我的npm run serve
可以工作!
options.clientLogLevel
值似乎不正确。 - Jérômewebpack.config.js
文件,那么我该如何更改 webpack 配置中的值呢?Webpack 的相关内容是由 VueJS 管理的。 - Arti Singh