Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native modules are compiled against the wrong headers #200

Open
nornagon opened this issue May 22, 2019 · 3 comments
Open

Native modules are compiled against the wrong headers #200

nornagon opened this issue May 22, 2019 · 3 comments

Comments

@nornagon
Copy link
Member

Example: https://gist.github.com/9f283e1b807667af397d46639dfb7c45

Error: The module '/private/var/folders/7w/g8kll6857_740r2sgt4prqkr0000gp/T/tmp-95900MdRX1JGTHapG/node_modules/robotjs/build/Release/robotjs.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 67. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (electron/js2c/asar.js:152:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:855:18)
    at Object.func [as .node] (electron/js2c/asar.js:152:31)
    at Module.load (internal/modules/cjs/loader.js:682:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:614:12)
    at Function.Module._load (internal/modules/cjs/loader.js:606:3)
    at Module.require (internal/modules/cjs/loader.js:720:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/private/var/folders/7w/g8kll6857_740r2sgt4prqkr0000gp/T/tmp-95900MdRX1JGTHapG/node_modules/robotjs/index.js:1:15)
    at Module._compile (internal/modules/cjs/loader.js:813:30)
@nornagon
Copy link
Member Author

NB. I think the best way to handle this would be to download the node headers along with Electron, e.g. from https://electronjs.org/headers/v4.2.0/node-v4.2.0-headers.tar.gz, and then run npm install with npm_config_nodedir=.../path/to/extracted/headers

@MarshallOfSound
Copy link
Member

@nornagon The issue is fiddle npm install's on every launch. Which makes building native modules quite tedious.

I originally wrote this feature into electron-rebuild to solve this issue --> electron/rebuild#242

The idea being fiddle could just run electron-rebuild on the temp dir and it would Handle All The Things

@nornagon
Copy link
Member Author

i'd rather a slow rebuild than a straight-up failure 🤷‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants