Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Jason Choi
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jason Choi
Front End Web Development Techdegree Graduate 21,159 Points

Problem installing node using Homebrew

Hello.

I tried to install node using the Homebrew based on this article (http://blog.teamtreehouse.com/install-node-js-npm-mac)

And I got the error saying the brew link step did not complete successfully.

Then it suggested using 'brew link node' so I did, but I still have an error.

This is what I got.

ChoiJinyoungs-MacBook-Pro:usr Jin$ brew install node ==> Downloading https://homebrew.bintray.com/bottles/node-9.5.0.high_sierra.bott Already downloaded: /Users/Jin/Library/Caches/Homebrew/node-9.5.0.high_sierra.bottle.tar.gz ==> Pouring node-9.5.0.high_sierra.bottle.tar.gz Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink include/node /usr/local/include is not writable.

You can try again using: brew link node ==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d ==> Summary ? /usr/local/Cellar/node/9.5.0: 5,125 files, 49.7MB ChoiJinyoungs-MacBook-Pro:usr Jin$ brew link node Linking /usr/local/Cellar/node/9.5.0... Error: Could not symlink include/node /usr/local/include is not writable. ChoiJinyoungs-MacBook-Pro:usr Jin$

I've tried 'brew uninstall node' and then installing again but still doesn't work.

Does anybody has the same issue?

Thank you very much! :)

James Churchill
James Churchill
Treehouse Teacher

Hi there! What version of macOS are you using?

1 Answer

James Churchill
STAFF
James Churchill
Treehouse Teacher

Jason,

Looks like you need to change permissions on the /usr/local directory. Here's an issue on the Homebrew GitHub repo that contains the suggested fix:

https://github.com/Homebrew/brew/issues/3228

Based upon the information in that issue, it looks like you need to run the following command from the terminal:

sudo chown -R $(whoami) $(brew --prefix)/*

After running that command, I'd then run brew doctor and then brew update before trying to install Node.js again.

I hope this helps.

Thanks, James