electron-react-boilerplate: Cannot run build

Hello,

Great boilerplate , I do get an error when trying to run the build:

Here is the stack trace:

[0] ERROR in ./~/fsevents/~/rc/index.js
[0] Module parse failed: /Users/saravieira/Desktop/electron-workshop/node_modules/fsevents/node_modules/rc/index.js Unexpected character '#' (1:0)
[0] You may need an appropriate loader to handle this file type.
[0] | #! /usr/bin/env node
[0] | var cc   = require('./lib/utils')
[0] | var join = require('path').join
[0]  @ ./~/fsevents/~/node-pre-gyp/lib/info.js 11:13-26
[0]  @ ./~/fsevents/~/node-pre-gyp/lib ^\.\/.*$
[0]  @ ./~/fsevents/~/node-pre-gyp/lib/node-pre-gyp.js
[0]  @ ./~/fsevents/fsevents.js
[0]  @ ./~/chokidar/lib/fsevents-handler.js
[0]  @ ./~/chokidar/index.js
[0]  @ ./~/electron-reload/main.js
[0]  @ ./app/main.dev.js
[0]  @ multi babel-polyfill ./app/main.dev
[0] 
[0] ERROR in unknown: Invalid number (230534:27)
[0] npm
[0]  ERR! code ELIFECYCLE
[0] npm ERR! errno 2
[0] npm ERR!
[0]  electron-workshop@1.0.2 build-main: `cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.main.prod.js --progress --profile --colors`
[0] npm ERR! Exit status 2
[0] npm ERR! 
[0] npm ERR!
[0]  Failed at the dagger@1.0.2 build-main script.
[0] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Has this happened to anyone ? In dev this run awesome

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 20 (9 by maintainers)

Most upvoted comments

I was getting the cryptic Invalid number error and the above solutions did not help me, and I spent a large amount of time trying to fix it. A variety of (relatively old and abandoned) modules I was importing would trigger this error, and after digging into those modules own dependencies and importing them directly, the Invalid number error actually came with some useful information:

if (typeof mode === 'function' || typeof mode === 'undefined') {
    callback = mode;
    mode = 0777 & (~process.umask());
           ^
}

 if (!callback) {

This came from the module mkpath. It turns out this is a deprecated way of writing an octal number in node, and babel will only accept the es6 way of (using the example) 0o777. So, at least in my case this error ended up having nothing to do with this boilerplate (which is great, thank you!), and I was able to solve the issue by adding a loader to the base config: octal-number-loader

I realize this issue is closed, but I wanted to leave this here in case anyone else came across it, especially since this git issue is the top Google result for “ERROR in unknown: Invalid number”.

same issue +1