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

binary node_modules are specific to NODE_MODULE_VERSION #810

Closed
dhylands opened this issue Mar 29, 2018 · 6 comments
Closed

binary node_modules are specific to NODE_MODULE_VERSION #810

dhylands opened this issue Mar 29, 2018 · 6 comments

Comments

@dhylands
Copy link
Contributor

Steps to reproduce:

git clone https://github.com/mozilla-iot/serial-adapter.git
cd serial-adapter
nvm use v7.10.1
yarn
./list-ports.js
nvm use --lts
./list-ports.js

The second time I run list-ports.js using node v8.10.0 but node_modules generated via node v7.10.1 I get the following error:

/home/dhylands/Dropbox/moziot/serial-adapter/node_modules/bindings/bindings.js:88
        throw e
        ^

Error: The module '/home/dhylands/Dropbox/moziot/serial-adapter/node_modules/serialport/build/Release/serialport.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 51. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:681:18)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at bindings (/home/dhylands/Dropbox/moziot/serial-adapter/node_modules/bindings/bindings.js:81:44)
    at Object.<anonymous> (/home/dhylands/Dropbox/moziot/serial-adapter/node_modules/serialport/lib/bindings/linux.js:2:36)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)

This implies that node binary dependencies are not only platform specific but at least node major version number specific.

I found this table which shows NODE_MODULE_VERSION in relationship to node.js version.

@mrstegeman
Copy link
Contributor

For reference, here's that table: https://nodejs.org/en/download/releases/

@mrstegeman
Copy link
Contributor

It seems like we should just build against the current LTS version and distribute that.

@hobinjk
Copy link
Contributor

hobinjk commented Mar 29, 2018

This is basically why #814 (which installs the node lts as a default) is important

@dhylands
Copy link
Contributor Author

dhylands commented Apr 2, 2018

That works for now, but when node v10 goes LTS we'll then run into the problem and need to install node v8 for version of the gateway still running that versus v10 for the newer gateway versions.

We can delay adding support for the time being, but we'll need to address it at some point.

@hobinjk
Copy link
Contributor

hobinjk commented Apr 2, 2018

This is true, I think the best way to address it is by pinning our LTS to node 8

@mrstegeman
Copy link
Contributor

Duplicates #1122

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

No branches or pull requests

3 participants