Getting the node Version produces "2.3.1"


#1

Hey there everyone! I am having an issue with running a bit of code. One of my modules checks the running node version using process.versions['node']. Without electron this runs fine and produces “0.12.2”, however when running in electron it produces “2.3.1”.

It is causing my application to crash so I was curious if there was a simple fix that I could implement without making a pull request to the module repository as it seems more like a bug rather then an issue they would need to implement.

So my question is, is there a way to set the node version, or is there another way around this issue?

The line of code in the module can be found here: https://github.com/zhangyuanwei/node-images/blob/master/binding.js#L48


#2

It’s the io.js version, since Electron ships with that instead of node.


#3

You can either install io.js 2.3.1 and use that to install native modules into your electron app or use electron-rebuild to build modules against the same version of io.js that electron uses.