Last active
April 23, 2021 10:58
-
-
Save ndaidong/d79ad36919c0ec2cba2e4f24bed8dccc to your computer and use it in GitHub Desktop.
Install Node.js on Endeavour, Debian, Fedora without building
This file contains hidden or 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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example: