Skip to content

Instantly share code, notes, and snippets.

@stolsma
Created September 10, 2015 13:33
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 stolsma/cd5f76b7a32a4c7a02c6 to your computer and use it in GitHub Desktop.
Save stolsma/cd5f76b7a32a4c7a02c6 to your computer and use it in GitHub Desktop.

Install first for ubuntu:

sudo apt-get install build-essential libssl-dev curl git-core

Compile the required Node.js version and put in global reach:

# install Node.js from Github (replace 4.0.0 with required version)
git clone https://github.com/nodejs/node.git node4.0.0
cd node4.0.0
git checkout v4.0.0
./configure --prefix=/usr/local/node4.0.0
make
sudo make install
cd ..

Add nodejs.sh script to /etc/profile.d

# set PATH so it includes Node.js bin
export PATH="/usr/local/node/bin":"${PATH}"

Link /usr/local/node to correct version:

sudo ln -s /usr/local/node4.0.0 /usr/local/node

Adding/changing /etc/sudoers.d/secure_path:

Defaults  secure_path=/usr/local/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

(BTW users capable to use sudo need to have the sudo group in their group list!!)

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