在创建Vue项目阶段,运行npm run dev报错,这是为什么
发布于 7 年前 作者 enoch 7140 次浏览 最后一次编辑是 7 年前 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

从昨天开始,我在创建新的项目时,运行npm run dev 就会报下面那个错误

j:\Vue\test>npm run dev

test@1.0.0 dev j:\Vue\test node build/dev-server.js

j:\Vue\test\node_modules\webpack\lib\webpack.js:19 throw new WebpackOptionsValidationError(webpackOptionsValidationErrors); ^

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration.output.path: The provided value “j:\Vue\test\dist” is not an absolute path!

at webpack (j:\Vue\test\node_modules\webpack\lib\webpack.js:19:9) at Object.<anonymous> (j:\Vue\test\build\dev-server.js:24:16) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:393:7) at startup (bootstrap_node.js:150:9) at bootstrap_node.js:508:3

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! test@1.0.0 dev: node build/dev-server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the test@1.0.0 dev script ‘node build/dev-server.js’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the test package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build/dev-server.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs test npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls test npm ERR! There is likely additional logging output above.

PS: npm已经是最新版本。昨天之前创建的项目都可以正常运行,并没有发生这个问题。

回到顶部