I am trying to install node.js
on my Raspberry Pi as well as GPIO
.
I am running a brand new install of Debian Jessie
I could get nodejs v.0.10.29 installed. No matter what I do, this is pretty much the most recent package I have been able to install even if a lot of post I read are speaking of version 4.0.0.
However v0.10.29 is running and I could run a simple http server.
The problem comes when I try to install GPIO. I have tried the following;
- rpi-gpio
- pi-gpio
- onoff
I can't get any of them to work and I have played around trying anything I could find on the web to fix it. I have tried pretty much everything.
So, since I probably messed up a lot of things, I reinstalled the OS Debian {Ed: Raspbian} Jessie and will give it another shot.
From there, what should I do after my OS is installed to get this to work?
Anyone have a good set of instruction for this - because I am probably missing something, right?
If anyone is willing to help I would gladly follow instructions and post any error messages I'm getting, because so far this is all I have been getting.
So I guess I will start with:
sudo apt-get update
What's next?
EDIT #1 Nodejs v0.10.29 is installed
I have installed Nodejs as suggested by Joan:
wget https://nodejs.org/dist/v4.3.1/node-v4.3.1-linux-armv6l.tar.xz
tar xf node-v4.3.1-linux-armv6l.tar.xz
cd node-v4.3.1-linux-armv6l/
sudo cp -R * /usr/local
nodejs -v
returned;
v0.10.29
EDIT#2 pi-gpio install
Now that node is installed I have try to turn a led on on pin 18 and got the following error;
module.js:340
throw err;
^
Error: Cannot find module 'pi-gpio'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/pi/NODE/http.js:22:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
So I have installed pi-gpio using npm;
sudo npm install pi-gpio
I am now getting this error;
Error when trying to open pin 18
/bin/sh: 1: gpio-admin: not found
Error when trying to close pin 18
/bin/sh: 1: gpio-admin: not found
So I will now install gpio-admin.
And this where it get messy because gpio-admin is old and wont install on the Debian Jessie So if anyone can come up with a way to turn on a led from Nodejs under Debian Jessie that would be awesome.