Just don't include the cmake flag that disables node.
Also, note that you'll want to use the raw pin references with mraa so they match up with the gpio board.
While the above sparkfun article is useful for installing MRAA for python, it is not so helpful for Node JS. To start, one needs to load swig 3.0+. I did this with the following commands:
These installs are needed to compile swig 3.0.5
# apt-get install libpcre3 libpcre3-dev
download latest swig from http://www.swig.org/download.html v3.0.5
# make install
# git clone https://github.com/intel-iot-devkit/mraa.git
# mkdir mraa/build && cd $_
# cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr
# make install
The final step is to load the latest node mraa library with # npm install mraa
Unfortunately, this yields the following errors:
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.10.17-poky-edison-ww42+
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/mraa
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! firstname.lastname@example.org install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! Failed at the email@example.com install script.
npm ERR! This is most likely a problem with the mraa package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mraa
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.10.17-poky-edison-ww42+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "mraa"
npm ERR! cwd /home/edison/js
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
Any idea of what I am doing wrong?
ANY TIPS OR POINTERS are GREATLY appreciate. Will summarize install instructions once I get this working.....