Skip to content

Instantly share code, notes, and snippets.

@lidox
Last active October 1, 2015 08:17
Show Gist options
  • Save lidox/efc211c962a8315fac98 to your computer and use it in GitHub Desktop.
Save lidox/efc211c962a8315fac98 to your computer and use it in GitHub Desktop.
Install node without having to sudo. (used for 1und1 server)
# take ownership of the folders that npm/node use
# please don't do this if you don't know what it does!
sudo mkdir -p /usr/local/{share/man,bin,lib/node,include/node}
sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}
# now just a pretty vanilla node install
# let it use the default paths, but don't use sudo, since there's no need
export PREFIX=
mkdir node-install
curl http://nodejs.org/dist/node-v0.4.3.tar.gz | tar -xzf - -C node-install
cd node-install/*
./configure && make && sudo make install
# now the npm easy-install: can't get npm to work :(
cd ..
git clone git://github.com/isaacs/npm.git
cd npm
sudo PATH=/path/to/node/bin/dir:$PATH make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment