Skip to content

Instantly share code, notes, and snippets.

@Alexthemediocre
Alexthemediocre / node_install.sh
Last active April 16, 2023 20:36
A script for installing Node.JS on Linux. Defaults to the newest available version and the linux-x64 distro. Also see https://nodejs.org/en/download/current and https://github.com/nodejs/help/wiki/Installation.
# shellcheck shell=sh
help () {
echo "Usage: ./node_install.sh [version[, distro]]"
echo "Pass 'help' as the first argument or '-h' or '--help' in any position to view this menu."
echo "The default distro is linux-x64. The default version is the newest release."
echo "Examples:"
echo $'./node_install\t\t\t\tInstalls the linux-x64 release of the newest version of Node.JS.'
echo $'./node_install v18.0.0\t\t\tInstalls the linux-x64 release of Node.JS v18.0.0.'
echo $'./node_install v18.0.0 linux-arm64\tInstalls the linux-arm64 release of Node.JS v18.0.0.'