Skip to content

Instantly share code, notes, and snippets.

@garronej
Last active October 16, 2017 23:12
Show Gist options
  • Save garronej/6a1eecb9dde9d9184014c5d25a9b6d1c to your computer and use it in GitHub Desktop.
Save garronej/6a1eecb9dde9d9184014c5d25a9b6d1c to your computer and use it in GitHub Desktop.
Installing node on raspberry pi
node -v
v0.10.29
sudo su
apt-get remove nodered -y
apt-get remove nodejs nodejs-legacy -y
apt-get remove npm -y # if you installed npm
cd /usr/src
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
# Check installation
node -v
npm -v
Fixing permissions:
Logged as pi:
mkdir ~/.npm-global
npm config set prefix '/home/pi/.npm-global'
Make shure we have : "export PATH=/home/pi/.npm-global/bin:$PATH" in .bashrc
sudo npm install -g npm@5.3.0
# Uninstall:
sudo aptitude remove node
sudo rm -rf /home/pi/.npm && sudo rm -rf /home/pi/.npm-global && sudo rm -rf /usr/local/lib/node_modules
# Optional:
To be able to run globaly installed package with sudo edit:
/etc/sudoers
Defaults secure_path="/home/pi/.npm-global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ref: http://node-arm.herokuapp.com/
@garronej
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment