我无法使用 Webpack 5 运行 npm start。我得到一个大对象输出和 2 个错误

发布于 2025-01-17 14:13:22 字数 1699 浏览 0 评论 0原文

正如标题所说,我在升级到WebPack 5后正在运行npm start。我无法适合整个对象,因此这是返回对象的最后几行:

  headerName: 'Webpack',
  baseDataPath: 'configuration',
  postFormatter: [Function: postFormatter]
}

这些是错误:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] open:src: `babel-node tools/srcServer.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] open:src 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\user1\AppData\Roaming\npm-cache\_logs\2022-03-29T17_53_33_649Z-debug.log
ERROR: "open:src" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm-run-all --parallel open:src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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\user1\AppData\Roaming\npm-cache\_logs\2022-03-29T17_53_33_691Z-debug.log

其他人遇到这个问题吗?

As the title says, I am having issues running npm start after upgrading to Webpack 5. I cannot fit the whole object, so here are the last few lines of the object that is returned:

  headerName: 'Webpack',
  baseDataPath: 'configuration',
  postFormatter: [Function: postFormatter]
}

These are the errors:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] open:src: `babel-node tools/srcServer.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] open:src 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\user1\AppData\Roaming\npm-cache\_logs\2022-03-29T17_53_33_649Z-debug.log
ERROR: "open:src" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm-run-all --parallel open:src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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\user1\AppData\Roaming\npm-cache\_logs\2022-03-29T17_53_33_691Z-debug.log

Has anyone else encountered this issue?

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

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

发布评论

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

评论(1

要走就滚别墨迹 2025-01-24 14:13:22

你可以使用 less 看到真正的错误消息,但输出是在 STDERR 上,因此你需要将其重定向到 STDOUT:

$ npm start 2>&1 | less

对我来说这是一个配置错误,我仍在使用 Webpack 4 样式键模块.规则

You can see the real error message with less, but the output is on STDERR, so you need to redirect it to STDOUT:

$ npm start 2>&1 | less

For me it was a configuration error, I was still using Webpack 4 style keys in module.rules.

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