我正在使用Electron-React-Boilerplate並試圖運行npm run build-renderer
,但腳本看起來已經完成時出現錯誤。Webpack腳本不會通過NPM運行,但會直接粘貼到終端上運行
如果我直接從終端粘貼與build-renderer
腳本相關的代碼,它不會失敗。
命令本身是:cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --display-error-details --config webpack.config.renderer.prod.js --progress --profile --colors
這是一個完整的輸出我得到,當它失敗。在我看來,沒有什麼可以幫助我診斷問題。
任何意見或想法將不勝感激!腳本的
輸出
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Slapbox\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build-renderer' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild-renderer', 'build-renderer', 'postbuild-renderer' ]
5 info lifecycle [email protected]~prebuild-renderer: [email protected]
6 silly lifecycle [email protected]~prebuild-renderer: no script for prebuild-renderer, continuing
7 info lifecycle [email protected]~build-renderer: [email protected]
8 verbose lifecycle [email protected]~build-renderer: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~build-renderer: PATH: C:\Users\Slapbox\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Projects\myApp\node_modules\.bin;C:\Users\Slapbox\.babun\cygwin\home\Slapbox\.local\bin;C:\Users\Slapbox\.babun\cygwin\usr\local\bin;C:\Users\Slapbox\.babun\cygwin\usr\local\bin;C:\Users\Slapbox\.babun\cygwin\usr\local\sbin;C:\Users\Slapbox\.babun\cygwin\home\Slapbox\.local\bin;C:\Users\Slapbox\.babun\cygwin\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\MySQL\MySQL Utilities 1.6;C:\Program Files\Perforce;C:\Users\Slapbox\AppData\Local\Programs\Python\Python35-32\Scripts;C:\Users\Slapbox\AppData\Local\Programs\Python\Python35-32;C:\Users\Slapbox\.babun;C:\Users\Slapbox\AppData\Roaming\npm\node_modules\jshint\bin;C:\Program Files\Perforce\Server;C:\Users\Slapbox\AppData\Roaming\npm;C:\adb;C:\Program Files\nodejs;C:\Program Files (x86)\Microsoft VS Code\bin
10 verbose lifecycle [email protected]~build-renderer: CWD: C:\Projects\myApp
11 silly lifecycle [email protected]~build-renderer: Args: [ '/d /s /c',
11 silly lifecycle 'cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --display-error-details --config webpack.config.renderer.prod.js --progress --profile --colors' ]
12 silly lifecycle [email protected]~build-renderer: Returned: code: 2 signal: null
13 info lifecycle [email protected]~build-renderer: Failed to exec build-renderer script
14 verbose stack Error: [email protected] build-renderer: `cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --display-error-details --config webpack.config.renderer.prod.js --progress --profile --colors`
14 verbose stack Exit status 2
14 verbose stack at EventEmitter.<anonymous> (C:\Users\Slapbox\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:194:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\Slapbox\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:194:7)
14 verbose stack at maybeClose (internal/child_process.js:899:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd C:\Projects\myApp
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Slapbox\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build-renderer"
19 error node v7.7.3
20 error npm v4.2.0
21 error code ELIFECYCLE
22 error errno 2
23 error [email protected] build-renderer: `cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --display-error-details --config webpack.config.renderer.prod.js --progress --profile --colors`
23 error Exit status 2
24 error Failed at the [email protected] build-renderer script 'cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --display-error-details --config webpack.config.renderer.prod.js --progress --profile --colors'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the myApp package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --display-error-details --config webpack.config.renderer.prod.js --progress --profile --colors
24 error You can get information on how to open an issue for this project with:
24 error npm bugs myApp
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls myApp
24 error There is likely additional logging output above.
25 verbose exit [ 2, true ]