electron-builder fails to package with native node module on Ubuntu
See original GitHub issue-
Version: 7.14.1
-
Target: Ubuntu 16.04 64bit
I’m trying to use node-system-idle-time in my electron app, I got the app running with electron-prebuilt
by navigating to node-modules/@paulcbetts/system-idle-time
and running
sudo HOME=~/.electron-gyp node-gyp rebuild --target=1.3.4 --arch=x64 --dist-url=https://atom.io/download/atom-s
h
but when I’m trying to build the app by electron-builder
I get this: any ideas? Thanks
Output:
> @paulcbetts/system-idle-time@1.0.4 install /home/epezhman/Projects/demand-manager-app/app/node_modules/@paulcbetts/system-idle-time
> node-gyp rebuild
make: Entering directory '/home/epezhman/Projects/demand-manager-app/app/node_modules/@paulcbetts/system-idle-time/build'
CXX(target) Release/obj.target/system_idle_time/src/module.o
system_idle_time.target.mk:95: recipe for target 'Release/obj.target/system_idle_time/src/module.o' failed
make: Leaving directory '/home/epezhman/Projects/demand-manager-app/app/node_modules/@paulcbetts/system-idle-time/build'
Error output:
In file included from /usr/include/errno.h:28:0,
from /home/epezhman/.electron-gyp/.node-gyp/iojs-1.4.3/deps/uv/include/uv-errno.h:25,
from /home/epezhman/.electron-gyp/.node-gyp/iojs-1.4.3/deps/uv/include/uv.h:48,
from ../../../nan/nan.h:46,
from ../src/module.h:4,
from ../src/module.cc:1:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
make: *** [Release/obj.target/system_idle_time/src/module.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-45-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/epezhman/Projects/demand-manager-app/app/node_modules/@paulcbetts/system-idle-time
gyp ERR! node -v v4.6.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "rebuild" "--production" "--cache-min" "999999999" "--build-from-source"
npm ERR! node v4.6.1
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! @paulcbetts/system-idle-time@1.0.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @paulcbetts/system-idle-time@1.0.4 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @paulcbetts/system-idle-time package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs @paulcbetts/system-idle-time
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls @paulcbetts/system-idle-time
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/epezhman/Projects/demand-manager-app/app/npm-debug.log
at ChildProcess.<anonymous> (/home/epezhman/Projects/demand-manager-app/node_modules/electron-builder/src/util/util.ts:160:14)
at ChildProcess.g (events.js:260:16)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:829:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
From previous event:
at spawn (/home/epezhman/Projects/demand-manager-app/node_modules/electron-builder/src/util/util.ts:123:3)
at spawnNpmProduction (/home/epezhman/Projects/demand-manager-app/node_modules/electron-builder/src/util/util.ts:49:3)
at Object.installDependencies (/home/epezhman/Projects/demand-manager-app/node_modules/electron-builder/src/util/util.ts:20:122)
at Packager.<anonymous> (/home/epezhman/Projects/demand-manager-app/node_modules/electron-builder/src/packager.ts:239:34)
at next (native)
at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
at tsAwaiter (/home/epezhman/Projects/demand-manager-app/node_modules/electron-builder/src/util/awaiter.ts:10:47)
at Object.build (/home/epezhman/Projects/demand-manager-app/node_modules/electron-builder/out/builder.js:138:12)
at /home/epezhman/Projects/demand-manager-app/tasks/build.js:59:28
at _fulfilled (/home/epezhman/Projects/demand-manager-app/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/home/epezhman/Projects/demand-manager-app/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/home/epezhman/Projects/demand-manager-app/node_modules/q/q.js:796:13)
at /home/epezhman/Projects/demand-manager-app/node_modules/q/q.js:604:44
at runSingle (/home/epezhman/Projects/demand-manager-app/node_modules/q/q.js:137:13)
at flush (/home/epezhman/Projects/demand-manager-app/node_modules/q/q.js:125:13)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickDomainCallback (node.js:390:13)
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cannot find module 'fs/promises' Electron JS - Stack Overflow
I realized that trying to fix another issue, I deleted the node_modules folder and the package-lock.json file, then run the npm install command....
Read more >Common Configuration - electron-builder
To package Proton Native app, set protonNodeVersion option to current or specific NodeJS version that you are packaging for. Currently, only macOS and...
Read more >Native Node Modules | Electron
This module can automatically determine the version of Electron and handle the manual steps of downloading headers and rebuilding native modules for your...
Read more >node-notifier - npm
A Node.js module for sending notifications on native Mac, ... Linux: notify-osd or libnotify-bin installed (Ubuntu should have this by ...
Read more >electron-builder | Yarn - Package Manager
npm version downloads per month donate project discussions. A complete solution to package and build a ready for distribution Electron, Proton Native app...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
See To build app in 32 bit from a machine with 64 bit
Thanks again for the answer, with those fixes now it’s building fine when targeting Linux x64 but when I’m trying to build for Linux ia32 I get the following error. does that mean the target node in native module is not compatible or? I’m on Ubuntu 16.04 x64 ,thanks