Skip to content
This repository was archived by the owner on Jul 30, 2022. It is now read-only.
This repository was archived by the owner on Jul 30, 2022. It is now read-only.

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

Description

@stevenkkim

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

> Reader@0.1.0 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! Reader@0.1.0 package: `webpack --config webpack.build.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the Reader@0.1.0 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 npm@5.6.0
3 info using node@v8.9.1
4 verbose run-script [ 'prepackage', 'package', 'postpackage' ]
5 info lifecycle Reader@0.1.0~prepackage: Reader@0.1.0
6 info lifecycle Reader@0.1.0~package: Reader@0.1.0
7 verbose lifecycle Reader@0.1.0~package: unsafe-perm in lifecycle true
8 verbose lifecycle Reader@0.1.0~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 Reader@0.1.0~package: CWD: C:\Users\Steven\Dev\reader\erb-basic
10 silly lifecycle Reader@0.1.0~package: Args: [ '/d /s /c', 'webpack --config webpack.build.config.js' ]
11 silly lifecycle Reader@0.1.0~package: Returned: code: 2  signal: null
12 info lifecycle Reader@0.1.0~package: Failed to exec package script
13 verbose stack Error: Reader@0.1.0 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 Reader@0.1.0
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 Reader@0.1.0 package: `webpack --config webpack.build.config.js`
22 error Exit status 2
23 error Failed at the Reader@0.1.0 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions