Skip to content

Instantly share code, notes, and snippets.

@teuteuguy
Last active April 11, 2022 17:17
Show Gist options
  • Select an option

  • Save teuteuguy/66156027a223f193d040e799987982bf to your computer and use it in GitHub Desktop.

Select an option

Save teuteuguy/66156027a223f193d040e799987982bf to your computer and use it in GitHub Desktop.
NodeJS for Ubuntu/Debian
#!/bin/bash
# Tested for NodeJS 12.18.0
# Tested on:
# - RPI
# - Jetson Nano
# Run this on your device with sudo
if [ "$EUID" -ne 0 ]
then echo "Please run as root / sudo"
exit
fi
set -e
echo "Downloading version: $1"
ARCH=`uname -m`
cd /tmp
wget https://nodejs.org/dist/v$1/node-v$1-linux-$ARCH.tar.gz
tar -xvf node-v$1-linux-$ARCH.tar.gz
cd node-v$1-linux-$ARCH
cp -R * /usr/local/
ln -s /usr/local/bin/node /usr/local/bin/nodejs12.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment