Last active
December 14, 2023 00:35
-
-
Save chi-feng/a503b6fe7ba3bab20471f8fc7ca93d0f to your computer and use it in GitHub Desktop.
Install node v18
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
#!/bin/bash | |
# Download and import the Nodesource GPG key | |
sudo apt-get update | |
sudo apt-get install -y ca-certificates curl gnupg | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | |
# Create deb repository | |
NODE_MAJOR=18 | |
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list | |
# Run Update and Install | |
sudo apt-get update | |
sudo apt-get install nodejs -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment