electron-react-boilerplate: Packaging Application with Webpack 2 Fails

My build used to only work if I had this flag --max_old_space_size=4096

I don’t know if that should be necessary anymore, but I know trying to use it causes a failure.

I’m failing on this command during packaging: build-renderer: cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.production.js --progress --profile --colors``

Here’s the full error log:

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 npm@4.2.0
3 info using node@v6.10.0
4 verbose run-script [ 'prebuild-renderer', 'build-renderer', 'postbuild-renderer' ]
5 info lifecycle myApp@1.1.0~prebuild-renderer: myApp@1.1.0
6 silly lifecycle myApp@1.1.0~prebuild-renderer: no script for prebuild-renderer, continuing
7 info lifecycle myApp@1.1.0~build-renderer: myApp@1.1.0
8 verbose lifecycle myApp@1.1.0~build-renderer: unsafe-perm in lifecycle true
9 verbose lifecycle myApp@1.1.0~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\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Projects\myApp\node_modules\.bin;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\bin;C:\Users\Slapbox\.babun\cygwin\home\Slapbox\.local\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
10 verbose lifecycle myApp@1.1.0~build-renderer: CWD: C:\Projects\myApp
11 silly lifecycle myApp@1.1.0~build-renderer: Args: [ '/d /s /c',
11 silly lifecycle   'cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.production.js --progress --profile --colors' ]
12 silly lifecycle myApp@1.1.0~build-renderer: Returned: code: 2  signal: null
13 info lifecycle myApp@1.1.0~build-renderer: Failed to exec build-renderer script
14 verbose stack Error: myApp@1.1.0 build-renderer: `cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.production.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:191: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:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid myApp@1.1.0
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 v6.10.0
20 error npm  v4.2.0
21 error code ELIFECYCLE
22 error errno 2
23 error myApp@1.1.0 build-renderer: `cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.production.js --progress --profile --colors`
23 error Exit status 2
24 error Failed at the myApp@1.1.0 build-renderer script 'cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.production.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 -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.production.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 ]

Thanks very much for any suggestions!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

Keeping up to date with the upstream is hard. We have to find ways to make this easier. I would recommend merging with the upstream frequently so that its easier to narrow the issue and the change set would be smaller instead of waiting for x number of releases to merge a huge change list

Ah I see. Thanks @amilajack I’ll try to play around with what I know now and see if I Can’t get a build together.