Last active
January 15, 2023 10:49
-
-
Save 190ikp/51febed3bc5a4744e02848ccd644ff28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
# This script is based on NodeSource's repository. | |
# see: https://github.com/nodesource/distributions | |
# shellcheck disable=SC1091 | |
source /etc/os-release | |
export NODE_VERSION=node_16.x | |
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | | |
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/nodesource.gpg --import | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/$NODE_VERSION $VERSION_CODENAME main" | | |
sudo tee /etc/apt/sources.list.d/nodesource.list | |
echo "deb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/$NODE_VERSION $VERSION_CODENAME main" | | |
sudo tee -a /etc/apt/sources.list.d/nodesource.list | |
sudo apt-get update | |
# npm included | |
sudo apt-get install --yes nodejs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment