I installed node.js according to this article .
For this i downloaded a precompiled node.js arm-pi distributition and unzipped it
cd /opt
sudo wget http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-arm-pi.tar.gz
After that i added the path to which node.js was unpacked tu the /.profile
export PATH=$PATH:/opt/node-v0.10.28-linux-arm-pi/bin
now
node --version
return 0.10.28
but when i run
sudo node --version
node isn't found.
I also tried to add the export path code to /root/.profile and restarted the node. But still node isn't found.
PS: is it right t hat 0.10.28 is the most current version supported for raspberrian, as there is no neweer *-linux-arm distribution?
Later on i Found that i could also install node.js with apt-get.
Getting NPM installed on Raspberry Pi (Wheezy Image)
Is that right ? what is the preferred way and whould this have solved the problem, that sudo doens't now node?
Any hints ?
Answers to the questions in the Comments:
pi@PiDuino /be/Serial $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/opt/node-v0.10.28-linux-arm-pi/bin
pi@PiDuino /be/Serial $ sudo echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/opt/node-v0.10.28-linux-arm-pi/bin
runnning
sudo /opt/node-v0.10.28-linux-arm-pi/bin/node
works
$PATH
used bysudo
.