Skip to content

Instantly share code, notes, and snippets.

@hfase01
Last active January 2, 2021 14:32
Show Gist options
  • Save hfase01/3446929 to your computer and use it in GitHub Desktop.
Save hfase01/3446929 to your computer and use it in GitHub Desktop.
Install nodejs from source
#!/bin/sh
#########
## This script simply installs Nodejs from source,
## eliminating the need for strange packaged versions.
##
## To run this script right from GitHub use the following command.
## (You will not see the password prompt at first though..)
##
## ~$ curl https://gist.githubusercontent.com/hfase01/3446929/raw/node.sh | sudo sh
##########
set -o verbose
HOME='/home/nodejs'
VER='v15.5.0'
if [ -d "$HOME" ]; then
cd $HOME
fi
if [ ! -d "$HOME" ]; then
mkdir -p $HOME && cd $HOME && git clone https://github.com/nodejs/node.git ./
fi
git checkout $VER
./configure sh
make
sudo make uninstall
./configure sh
make
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment