node.js - 尝试编译 react 时 webpack 退出状态 4294967295

标签 node.js reactjs npm webpack

我正在尝试创建我的第一个 React 项目并尝试教程。我的 webpack 配置基于该示例项目,但是当我运行 webpack 时,出现错误。这是 npm 调试日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\daford\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'production' ]
2 info using npm@3.8.6
3 info using node@v5.10.0
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle nestlepronourish@1.0.0~preproduction: nestlepronourish@1.0.0
6 silly lifecycle nestlepronourish@1.0.0~preproduction: no script for preproduction, continuing
7 info lifecycle nestlepronourish@1.0.0~production: nestlepronourish@1.0.0
8 verbose lifecycle nestlepronourish@1.0.0~production: unsafe-perm in lifecycle true
9 verbose lifecycle nestlepronourish@1.0.0~production: PATH: C:\Users\daford\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\daford\Projects\nestlepronourish.v2\node_modules\.bin;C:\Program Files\nodejs;C:\Ruby21-x64\bin;C:\cygwin64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Python\Scripts\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\GitExtensions\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Ruby21-x64\bin;C:\Ruby21-x64/lib/ruby/gems/2.1.0;C:\HashiCorp\Vagrant\bin;C:\gitflow;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;C:\Program Files (x86)\Bitvise SSH Client;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.8.0_77\bin;C:\Program Files\Java\apache-maven-3.3.9\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Python\Scripts\;C:\Program Files (x86)\Python\;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\daford\AppData\Local\Programs\Python\Python35-32;C:\Users\daford\AppData\Roaming\npm
10 verbose lifecycle nestlepronourish@1.0.0~production: CWD: C:\Users\daford\Projects\nestlepronourish.v2
11 silly lifecycle nestlepronourish@1.0.0~production: Args: [ '/d /s /c', 'webpack -p' ]
12 silly lifecycle nestlepronourish@1.0.0~production: Returned: code: 4294967295  signal: null
13 info lifecycle nestlepronourish@1.0.0~production: Failed to exec production script
14 verbose stack Error: nestlepronourish@1.0.0 production: `webpack -p`
14 verbose stack Exit status 4294967295
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\daford\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:239:16)
14 verbose stack     at emitTwo (events.js:100:13)
14 verbose stack     at EventEmitter.emit (events.js:185:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\daford\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:100:13)
14 verbose stack     at ChildProcess.emit (events.js:185:7)
14 verbose stack     at maybeClose (internal/child_process.js:850:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid nestlepronourish@1.0.0
16 verbose cwd C:\Users\daford\Projects\nestlepronourish.v2
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\daford\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "production"
19 error node v5.10.0
20 error npm  v3.8.6
21 error code ELIFECYCLE
22 error nestlepronourish@1.0.0 production: `webpack -p`
22 error Exit status 4294967295
23 error Failed at the nestlepronourish@1.0.0 production script 'webpack -p'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the nestlepronourish package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     webpack -p
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs nestlepronourish
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls nestlepronourish
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

我试过搜索但无法弄清楚问题出在哪里。我的npm版本是3.8.6,我的node版本是5.10.0

我才刚刚开始,所以到目前为止我只有一个 Hello World React 组件。

提前致谢。

最佳答案

我在 webpack.config.js 文件中有一个语法错误。我把 module.export = {...} 当它应该是 module.exports={...}

关于node.js - 尝试编译 react 时 webpack 退出状态 4294967295,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36724785/

相关文章:

node.js - 有没有办法检测 package.json 中需要编译的模块?

node.js - 带有请求的 jasmine-node - 测试重定向的端点不遵循重定向

javascript - 像 exports.default = (0, _createHelper2.default)(pure, 'pure' , 1) 这样写 Javascript 的目的是什么?

npm - 未找到 scss-bundle 命令

node.js - 如何安装同一个 node.js 模块的多个版本?

javascript - 为可重用的 React 组件存储全局变量的最佳方法是什么?

node.js - Node JS - 无法终止使用子进程 Exec 执行的进程

javascript - 如何将此函数带参数传递给settimeout?

javascript - 当文本输入更改时更新组件列表中子组件的状态

javascript - 调用 browserHistory.push ("/url"后 componentDidMount 未运行)