Skip to content

Instantly share code, notes, and snippets.

@eddywashere
Last active October 8, 2015 04:58
Show Gist options
  • Save eddywashere/3281348 to your computer and use it in GitHub Desktop.
Save eddywashere/3281348 to your computer and use it in GitHub Desktop.
Install nodejs for a local user with git

setup directory and clone from githhub

mkdir ~/.local

cd ~/.local

git clone https://github.com/joyent/node.git

cd node

view tagged releases. (note these are not branches, just tagged commits for releases)

git tag -l

checkout tagged release

git checkout -b v#.#.##

Before compiling, change install path to help prevent permission problems (do this when updating version!!)

./configure --prefix=~/.local

installation

make && make install

Add environment var (production for servers or development for local development)

echo "\export NODE_ENV=development" >> ~/.zshrc

Add directory to path (.zshrc or .bash_profile or .bashrc or whatevs)

echo "\nexport NODE_PATH=\$HOME/.local/lib/node_modules" >> ~/.zshrc
echo "\nexport PATH=\$HOME/.local/bin:\$PATH" >> ~/.zshrc
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment