Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script to set up NodeJS on RPi
#!/bin/bash
# Script to set up NodeJS on RPi
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Time this script
T="$(date +%s)"
echo
echo "*** Downloading and installing latest Node"
echo
echo
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
dpkg -i node_latest_armhf.deb
echo
echo "**** NodeJS installed:"
node -v
echo
T="$(($(date +%s)-T))"
echo "Time spent: $T"%
#!/bin/bash
# Script to set up NodeJS on RPi
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Time this script
T="$(date +%s)"
echo
echo "*** Downloading and installing latest Node"
echo
echo
wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv6l.tar.gz
tar -xvf node-v4.0.0-linux-armv6l.tar.gz
cd node-v4.0.0-linux-armv6l
cp -R * /usr/local/
cd ..
rm node-v4.0.0-linux-armv6l.tar.gz
rm -rf node-v4.0.0-linux-armv6l
echo
echo "**** NodeJS installed:"
node -v
echo
T="$(($(date +%s)-T))"
echo "Time spent: $T"%
#!/bin/bash
# Script to set up NodeJS on RPi
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Time this script
T="$(date +%s)"
echo
echo "*** Downloading and installing latest Node"
echo
echo
wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz
tar -xvf node-v4.0.0-linux-armv7l.tar.gz
cd node-v4.0.0-linux-armv7l
cp -R * /usr/local/
cd ..
rm node-v4.0.0-linux-armv7l.tar.gz
rm -rf node-v4.0.0-linux-armv7l
echo
echo "**** NodeJS installed:"
node -v
echo
T="$(($(date +%s)-T))"
echo "Time spent: $T"%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment