javascript 运行 npm start 时无法执行启动脚本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47842969/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 07:37:39  来源:igfitidea点击:

Failed to exec start script when running npm start

javascriptnode.js

提问by Sreejesh K Nair

I am receiving this error when trying to start my node application using the npm start command.

尝试使用 npm start 命令启动我的节点应用程序时收到此错误。

Error from command prompt

命令提示符出错

From log

从日志



10 verbose lifecycle @~start: CWD: F:\reactjs

10 冗长的生命周期@~start: CWD: F:\reactjs

11 silly lifecycle @~start: Args: [ '/d /s /c', 'webpack-dev-server --hot' ]

11 愚蠢的生命周期@~start: Args: [ '/d /s /c', 'webpack-dev-server --hot' ]

12 silly lifecycle @~start: Returned: code: 4294967295 signal: null

12傻生命周期@~start:返回:代码:4294967295信号:空

13 info lifecycle @~start: Failed to exec start script

13 info生命周期@~start: 执行启动脚本失败

14 verbose stack Error: @ start: webpack-dev-server --hot

14 详细堆栈错误:@开始: webpack-dev-server --hot

14 verbose stack Exit status 4294967295

14 详细堆栈退出状态 4294967295

14 verbose stack at EventEmitter. (E:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)

EventEmitter 上的 14 个详细堆栈。(E:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)

14 verbose stack at emitTwo (events.js:106:13)

14 冗长的堆栈在emitTwo (events.js:106:13)

14 verbose stack at EventEmitter.emit (events.js:191:7)

EventEmitter.emit 上的 14 个详细堆栈 (events.js:191:7)

14 verbose stack at ChildProcess. (E:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)

ChildProcess 中的 14 个详细堆栈。(E:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)

14 verbose stack at emitTwo (events.js:106:13)

14 冗长的堆栈在emitTwo (events.js:106:13)

14 verbose stack at ChildProcess.emit (events.js:191:7)

ChildProcess.emit 上的 14 个详细堆栈 (events.js:191:7)

14 verbose stack at maybeClose (internal/child_process.js:920:16)

14 详细堆栈在可能关闭 (internal/child_process.js:920:16)

14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)

Process.ChildProcess._handle.onexit (internal/child_process.js:230:5) 上的 14 个详细堆栈

15 verbose pkgid @

15 详细 pkid @

16 verbose cwd F:\reactjs

16 详细 cwd F:\reactjs

17 error Windows_NT 10.0.10586

17 错误 Windows_NT 10.0.10586

18 error argv "E:\Program Files\nodejs\node.exe" "E:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"

18 错误argv "E:\Program Files\nodejs\node.exe" "E:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"

19 error node v6.11.3

19 错误节点 v6.11.3

20 error npm v3.10.10

20 错误 npm v3.10.10

21 error code ELIFECYCLE

21 错误代码 ELIFECYCLE

22 error @ start: webpack-dev-server --hot

22 错误@开始: webpack-dev-server --hot

22 error Exit status 4294967295

22 错误退出状态 4294967295

23 error Failed at the @ start script 'webpack-dev-server --hot'.

23 错误 @start 脚本“webpack-dev-server --hot”失败。

23 error Make sure you have the latest version of node.js and npm installed.

23 错误确保您安装了最新版本的 node.js 和 npm。

23 error If you do, this is most likely a problem with the package,

23 错误如果你这样做,这很可能是包的问题,

23 error not with npm itself.

23 错误与 npm 本身无关。

23 error Tell the author that this fails on your system:

23 错误告诉作者,这在你的系统上失败了:

23 error webpack-dev-server --hot

23 错误 webpack-dev-server --hot

23 error You can get information on how to open an issue for this project with:

23 错误您可以通过以下方式获取有关如何为此项目打开问题的信息:

23 error npm bugs

23 个错误的 npm 错误

23 error Or if that isn't available, you can get their info via:

23 错误 或者,如果该错误不可用,您可以通过以下方式获取他们的信息:

23 error npm owner ls

23 错误 npm 所有者 ls

23 error There is likely additional logging output above.

23 错误 上面可能有额外的日志输出。



回答by Peter Grainger

Your issue is in your webpack configuration.

您的问题在于您的 webpack 配置。

The line that gives you this error is line 4

给你这个错误的行是第 4 行

Configuration file found but no entry configured

This might help:

这可能有帮助:

Webpack configuration file found but no entry configured

找到了 webpack 配置文件但没有配置条目

here is the docs on webpack for entry: https://webpack.github.io/docs/configuration.html#entry

这是 webpack 上的文档以供入门:https://webpack.github.io/docs/configuration.html#entry