升级webpack4.26.1 npm run dev报错Failed at the project dev script.

发布于 2022-09-11 16:08:53 字数 3223 浏览 15 评论 0

用vue-cli搭建的项目,默认是webpack3.6.0,然后给它升级到webpack4.26.1,经过一系列的操作解决了一堆报错。。。这个错不知道怎么解决了,求指教图片描述

package.json
图片描述
日志详情:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm@5.6.0
3 info using node@v8.9.1
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle vue-project@1.0.0~predev: vue-project@1.0.0
6 info lifecycle vue-project@1.0.0~dev: vue-project@1.0.0
7 verbose lifecycle vue-project@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle vue-project@1.0.0~dev: PATH: C:UsersAdministratorAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;F:vue-projectnode_modules.bin;%MAVEN_HOME/bin%;%MYSQL_HOME%bin;%JAVA_HOME%bin;C:ProgramDataOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)Gitcmd;C:Program Filesnodejs;C:Program FilesTortoiseSVNbin;D:Fiddler;C:UsersAdministratorAppDataRoamingnpm
9 verbose lifecycle vue-project@1.0.0~dev: CWD: F:vue-project
10 silly lifecycle vue-project@1.0.0~dev: Args: [ '/d /s /c',
10 silly lifecycle 'webpack-dev-server --inline --progress --config build/webpack.dev.conf.js' ]
11 silly lifecycle vue-project@1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle vue-project@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: vue-project@1.0.0 dev: webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:UsersAdministratorAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecycleindex.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:UsersAdministratorAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid vue-project@1.0.0
15 verbose cwd F:vue-project
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "dev"
18 verbose node v8.9.1
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error vue-project@1.0.0 dev: webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
22 error Exit status 1
23 error Failed at the vue-project@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

新一帅帅 2022-09-18 16:08:53

请问你解决了吗?我也遇到这个问题了

少跟Wǒ拽 2022-09-18 16:08:53

webpack3 升级到 webpack4 确实会遇到一些问题,主要是自身的依赖,及周边的 loaderplugins。提供一个已经升级好的项目模板,可以参考下,传送门

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文