Search code examples
node.jsnw.jsnode-serialport

Running node-serialport in nw.js


I am trying to run node-serialport in nw.js. After following the nw.js documentation concerning native modules, node-serialport seems to build just fine, and runs perfectly in a regular node process.

Unfortunately, I get the following error in the nw.js console window:

{project_dir}\node_modules\serialport\node_modules\bindings\bindings.js:83 Uncaught Error: Module version mismatch. Expected 48, got 46.

How can I run these together? Am I missing something obvious?

Note that I'm currently running:

  • Windows 7 x64
  • Node v4.4.4
  • npm v2.4.1
  • nw.js v0.15.0
  • node-gyp v3.3.1
  • serialport v3.1.2

Solution

  • Apparently I needed to update to the Current version of Node (v6.2.0) instead of the LTS version (v4.4.4). After updating and rebuilding serialport, everything works perfectly!