I'm using node.js on Edison. I updated node.js to 0.12.5 version with this instruction:
I let the 'make' command run over night then found my laptop sleeping, but the Edison board was still turned on. Then I ran 'make install' without any error.
However, the upgrade, including mraa library shows the error below. Why does this happen and what should I do to get mraa included successfully?
root@Eddie:~/AIRDispenser# node --version
> var mraa = require('mraa')
Error: Module did not self-register.
at Error (native)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at REPLServer.defaultEval (repl.js:132:27)
at bound (domain.js:254:14)
at REPLServer.runBound [as eval] (domain.js:267:12)
at REPLServer. (repl.js:279:12)
I've been doing some research and according to some other threads it's possible that you first have to compile mraa after compiling node. Another option would be that an older version of node is still present on the board and is being chosen instead of the node 0.12.5. And one last possibility is that mraa requires an npm-gyp rebuild, as it's specified in this thread /thread/93530 https://communities.intel.com/thread/93530.
By now I have heard about 2 success stories with 0.12.5 and mraa. I myself also ran into issues. Maybe someone could post the steps to have 0.12.5 and mraa working together.
That said Node 4.x, and 5.x seem to work easier together with mraa.
Might make more sense to move to there?
Yes in order to recompile it you'll just need to run the make command, for that you can follow the instructions from here: /thread/57152 https://communities.intel.com/thread/57152.
About your first question, let us investigate this and we'll get back to you soon.
I was able to use mraa using node 0.12.7 (installed by the AlexT repository). The trick is to add to the to the dependencies section of package.json file this line:
It is important to use the 0.8.0 because latest version 0.8.1 doesn't work. I hope this workaround can work also on node 0.12.5.
I'd like Intel will release a new image with node 0.12 preinstalled.