Skip to content

Instantly share code, notes, and snippets.

@Critter
Created February 13, 2015 21:21
Show Gist options
  • Save Critter/c52dc9257f40ded4dfc1 to your computer and use it in GitHub Desktop.
Save Critter/c52dc9257f40ded4dfc1 to your computer and use it in GitHub Desktop.
Install and link node with brew
Critter:lib critter$ brew install node
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/node-0.12.0.yosemite.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring node-0.12.0.yosemite.bottle.1.tar.gz
==> Caveats
If you update npm itself, do NOT use the npm update command.
The upstream-recommended way to update npm is:
npm install -g npm@latest
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/node/android-ifaddrs.h
/usr/local/include/node is not writable.
You can try again using:
brew link node
==> Summary
🍺 /usr/local/Cellar/node/0.12.0: 2196 files, 25M
Critter:lib critter$ brew link node
Linking /usr/local/Cellar/node/0.12.0...
Error: Could not symlink include/node/android-ifaddrs.h
/usr/local/include/node is not writable.
Critter:lib critter$ sudo brew link node
Error: Cowardly refusing to `sudo brew link`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
Critter:lib critter$ sudo chown -R `whoami` /usr/local/include/node
Critter:lib critter$ brew link node
Linking /usr/local/Cellar/node/0.12.0... 43 symlinks created
Critter:lib critter$
@coisnepe
Copy link

Thanks for sharing. For what it's worth, here's a more readable version

$ brew install node
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/node-0.12.0.yosemite.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring node-0.12.0.yosemite.bottle.1.tar.gz
==> Caveats
If you update npm itself, do NOT use the npm update command.
The upstream-recommended way to update npm is:
  npm install -g npm@latest

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/node/android-ifaddrs.h
/usr/local/include/node is not writable.

You can try again using:
  brew link node
==> Summary
/usr/local/Cellar/node/0.12.0: 2196 files, 25M

$ brew link node
Linking /usr/local/Cellar/node/0.12.0... 
Error: Could not symlink include/node/android-ifaddrs.h
/usr/local/include/node is not writable.

$ sudo brew link node
Error: Cowardly refusing to `sudo brew link`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.

$ sudo chown -R `whoami` /usr/local/include/node
$ brew link node
Linking /usr/local/Cellar/node/0.12.0... 43 symlinks created

@joriki
Copy link

joriki commented Apr 21, 2018

Thanks, worked for me!

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