Created
August 23, 2023 17:24
-
-
Save Grubba27/890609247e020de23659570ddeb326b2 to your computer and use it in GitHub Desktop.
installing Node.js 14.21.4
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 | |
# Set environment variables | |
NODE_VERSION="14.21.4" | |
NODE_URL="https://static.meteor.com/dev-bundle-node-os/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" | |
DIR_NODE="/usr/local" | |
# Download and install Node.js using wget | |
wget -qO- "$NODE_URL" | tar -xz -C "$DIR_NODE"/ && mv "$DIR_NODE"/node-v${NODE_VERSION}-linux-x64 "$DIR_NODE"/v$NODE_VERSION | |
# Add node and npm to the PATH so the commands are available | |
export NODE_PATH="$DIR_NODE/v$NODE_VERSION/lib/node_modules" | |
export PATH="$DIR_NODE/v$NODE_VERSION/bin:$PATH" | |
# Confirm the installation | |
node -v | |
npm -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment