Skip to content

Instantly share code, notes, and snippets.

@ndaidong
Last active April 23, 2021 10:58
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ndaidong/d79ad36919c0ec2cba2e4f24bed8dccc to your computer and use it in GitHub Desktop.
Save ndaidong/d79ad36919c0ec2cba2e4f24bed8dccc to your computer and use it in GitHub Desktop.
Install Node.js on Endeavour, Debian, Fedora without building
#!/bin/bash
export NODE_VERSION=14.16.1
export NODE_DOWNLOAD_URL=https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz
export NODE_INSTALL=/opt/node
export PATH=$NODE_INSTALL/bin:$PATH
sudo mkdir $NODE_INSTALL
sudo chown -R ${USER} $NODE_INSTALL
if [ ! -f "node-v$NODE_VERSION-linux-x64.tar.xz" ]; then
wget "$NODE_DOWNLOAD_URL"
fi
if [ -d $NODE_INSTALL ]; then
rm -rf $NODE_INSTALL
fi
mkdir -p $NODE_INSTALL
tar -xJvf node-v$NODE_VERSION-linux-x64.tar.xz -C $NODE_INSTALL --strip-components=1
# npm i -g npm mdpdf npm-check-updates pnpm yarn
node --version
npm --version
@ndaidong
Copy link
Author

ndaidong commented Dec 6, 2018

For example:

VERSION=10.14.1 sh install-node.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment