Sunday, April 6, 2014

Fix for homebrew permission denied issues

1) installing and fixing node.JS
brew install node

~ chrisfu$ brew install node

==> Downloading http://nodejs.org/dist/v0.10.4/node-v0.10.4.tar.gz

Already downloaded: /Library/Caches/Homebrew/node-0.10.4.tar.gz

==> ./configure --prefix=/usr/local/Cellar/node/0.10.4

==> make install

Warning: Could not link node. Unlinking...

Error: The `brew link` step did not complete successfully

The formula built, but is not symlinked into /usr/local

You can try again using `brew link node'

==> Summary

/usr/local/Cellar/node/0.10.4: 951 files, 14M, built in 73 seconds

2) brew link node
~ chrisfu$ brew link node

Linking /usr/local/Cellar/node/0.10.4... Warning: Could not link node. Unlinking...


Error: Could not symlink file: /usr/local/Cellar/node/0.10.4/lib/dtrace/node.d

Target /usr/local/lib/dtrace/node.d already exists. You may need to delete it.

To force the link and delete this file, do:

  brew link --overwrite formula_name

To list all files that would be deleted:

  brew link --overwrite --dry-run formula_name

3) brew link --overwrite node
Linking /usr/local/Cellar/node/0.10.4... Warning: Could not link node. Unlinking...


Error: Permission denied - /usr/local/lib/dtrace/node.d

4) sudo chown -R whoami /usr/local as sudoing homebrew is a bad idea (and doesn't work either) we have to reset the permissions within /usr/local
~ chrisfu$ sudo chown -R `whoami` /usr/local

Password:

~ chrisfu$ brew link --overwrite node

Linking /usr/local/Cellar/node/0.10.4... 5 symlinks created

~ chrisfu$ sudo chown -R `whoami` /usr/local is the key step 5) STEPS brew update brew upgrade brew cleanup brew install node brew link --overwrite node sudo chown -R whoami /usr/local

No comments:

Post a Comment