Skip to content

Instantly share code, notes, and snippets.

@inlikealion
Last active December 31, 2015 04:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inlikealion/7935203 to your computer and use it in GitHub Desktop.
Save inlikealion/7935203 to your computer and use it in GitHub Desktop.
# this way is best if you want to stay up to date
# or submit patches to node or npm
mkdir ~/local
# I use .bash_profile instead of .bashrc
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bash_profile
. ~/.bash_profile
# could also fork, and then clone your own fork instead of the official one
git clone git://github.com/joyent/node.git
cd node
# find out the latest release (for now on the 0.10.x track for compatibility with yeoman, grunt, etc)
git tag -l
git checkout tags/v0.10.xx
./configure --prefix=$HOME/local
# the -j flag uses all available cores, so make is much faster
make install -j
cd ..
# npm now comes with nodejs, so we should be good to go
@inlikealion
Copy link
Author

Following @isaac’s famous install gist, I’ll edit and add comments to this to document what works for me.

@inlikealion
Copy link
Author

Added the git checkout … lines to get specific tag to make instead of tip.

@inlikealion
Copy link
Author

You may need to change permissions:

sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` ~/local/lib/node_modules

as per these answers on Stack Overflow.

@inlikealion
Copy link
Author

UPDATE:

Slightly more simple and in line with official reqs (note: remember to checkout a specific release tag prior to the following [not shown in Joyent’s instructions]). According to the official wiki:

$ export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
$ export CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
$ ./configure && make && sudo make install

Followed by:

$ sudo chown -R `whoami` ~/.npm
$ sudo chown -R `whoami` /usr/local/lib/node_modules

SEEMS to be working for me now.

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