Skip to content

Instantly share code, notes, and snippets.

@l4sh
Last active January 29, 2016 05:49
Show Gist options
  • Save l4sh/0dc43c6a07a464f2c751 to your computer and use it in GitHub Desktop.
Save l4sh/0dc43c6a07a464f2c751 to your computer and use it in GitHub Desktop.
Install Node.js and NPM from source
# Install dependencies (these are for Fedora, adapt to your distro)
# gcc-c++ make glibc-devel openssl openssl-devel
# Make a temporary working dir
mkdir nodebuild
cd nodebuild
# Download latest node.js source
wget http://nodejs.org/dist/node-latest.tar.gz
# Untar
tar -xvpzf node-latest.tar.gz
# Build
cd node-v*
./configure
make
sudo make install
# Install npm
wget http://npmjs.org/install.sh
sudo bash install.sh
# In Fedora it throws an error when trying to run npm with sudo, this is due to the secure
# path setting in /etc/sudoers. To solve it edit the sudoers file and add /usr/local/bin
# and /usr/local/sbin to the allowed path.
#
# Look for the line "Defaults secure_path = /sbin/..." and add the corresponding paths.
#
# It should look like...
#
# Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment