basic-electron-react-boilerplate icon indicating copy to clipboard operation
basic-electron-react-boilerplate copied to clipboard

'npm run build' and 'npm run package' not working; ERROR in unknown: Invalid number (31727:15)

Open stevenkkim opened this issue 7 years ago • 0 comments

Hi Phillip, I really like your basic electron-react boilerplate, it's been working great for me in development. 'npm run dev' works fine for me, but I am getting the following error when trying to build for production:

npm run package

> [email protected] package C:\Users\Steven\Dev\reader\erb-basic
> webpack --config webpack.build.config.js

Hash: 82c0f55fc43edc9c11f2
Version: webpack 3.6.0
Time: 4432ms
     Asset       Size  Chunks                    Chunk Names
 bundle.js    2.21 MB       0  [emitted]  [big]  main
bundle.css  371 bytes       0  [emitted]         main
index.html  227 bytes          [emitted]

ERROR in unknown: Invalid number (30327:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] package: `webpack --config webpack.build.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] package 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\Steven\AppData\Roaming\npm-cache\_logs\2017-12-22T05_47_19_204Z-debug.log

debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\dev\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Steven\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'package' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prepackage', 'package', 'postpackage' ]
5 info lifecycle [email protected]~prepackage: [email protected]
6 info lifecycle [email protected]~package: [email protected]
7 verbose lifecycle [email protected]~package: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~package: PATH: C:\Users\Steven\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Steven\Dev\reader\erb-basic\node_modules\.bin;C:\Users\Steven\bin;C:\dev\git\mingw64\bin;C:\dev\git\usr\local\bin;C:\dev\git\usr\bin;C:\dev\git\usr\bin;C:\dev\git\cmd;C:\Program Files\Docker\Docker\Resources\bin;C:\Dev\Python36\Scripts;C:\Dev\Python36;C:\Perl64\site\bin;C:\Perl64\bin;C:\dev\python\Scripts;C:\dev\python;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Calibre2;C:\Program Files (x86)\Calibre2;C:\Program Files (x86)\Plantronics\Spokes3G;C:\dev\git\cmd;C:\Program Files (x86)\Vagrant\bin;C:\Program Files (x86)\Pandoc;C:\Program Files (x86)\QuickTime\QTSystem;C:\Dev\Git\cmd;C:\dev\yarn\bin;C:\dev\nodejs;C:\dev\railsinstaller\Ruby2.3.3\bin;C:\ProgramData\RailsInstaller\Git\cmd;C:\ProgramData\RailsInstaller\Ruby2.3.0\bin;C:\Users\Steven\AppData\Local\atom\bin;C:\Users\Steven\AppData\Local\Microsoft\WindowsApps;C:\Dev\Git\bin\git.exe;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Kalabox\bin;C:\Program Files\Lando\bin;C:\Program Files\wkhtmltopdf\bin;C:\Program Files\KindleGen;C:\Program Files\7-Zip;C:\Program Files\AutoHotkey;C:\Users\Steven\AppData\Local\GitHubDesktop\bin;C:\Users\Steven\AppData\Local\Yarn\bin;C:\Users\Steven\AppData\Local\inkdrop\bin;C:\Users\Steven\AppData\Roaming\npm;C:\dev\git\usr\bin\vendor_perl;C:\dev\git\usr\bin\core_perl
9 verbose lifecycle [email protected]~package: CWD: C:\Users\Steven\Dev\reader\erb-basic
10 silly lifecycle [email protected]~package: Args: [ '/d /s /c', 'webpack --config webpack.build.config.js' ]
11 silly lifecycle [email protected]~package: Returned: code: 2  signal: null
12 info lifecycle [email protected]~package: Failed to exec package script
13 verbose stack Error: [email protected] package: `webpack --config webpack.build.config.js`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\Steven\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\Steven\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Steven\Dev\reader\erb-basic
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\dev\\nodejs\\node.exe" "C:\\Users\\Steven\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "package"
18 verbose node v8.9.1
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] package: `webpack --config webpack.build.config.js`
22 error Exit status 2
23 error Failed at the [email protected] package script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

My only alteration to the webpack config files is the following, which I had to include to get electron-store to work:

module.exports = {
  ...
  externals: [{ 'electron-store': 'require("electron-store")' }],
  ...
};

I've searched google for answers and tried a bunch of things, but nothing has worked. This seems like a similar problem, but none of the solutions worked for me.

Any idea what may be the problem? The only thing I can think of doing next is removing electron-store from my code and using a different module for local json storage, but I'm reluctant to refactor my code for a different module because electron-store works well and I'm not even sure it's the problem here.

Thanks!

stevenkkim avatar Dec 22 '17 06:12 stevenkkim