Skip to content

Instantly share code, notes, and snippets.

@Grubba27
Created August 23, 2023 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Grubba27/890609247e020de23659570ddeb326b2 to your computer and use it in GitHub Desktop.
Save Grubba27/890609247e020de23659570ddeb326b2 to your computer and use it in GitHub Desktop.
installing Node.js 14.21.4
#!/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