Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonidy/35e47e4c7ed7718a2a69176e3a582cdd to your computer and use it in GitHub Desktop.
Save tonidy/35e47e4c7ed7718a2a69176e3a582cdd to your computer and use it in GitHub Desktop.

Homebrew Permissions Denied Issues Solution

Installing and fixing node.JS


brew install node

$ 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

brew link node

$ 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

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

sudo chown -R $(whoami) /usr/local

Sudoing homebrew is a bad idea (and doesn't work either) we have to reset the permissions within /usr/local

$ sudo chown -R $(whoami) /usr/local
Password:
$ brew link --overwrite node
Linking /usr/local/Cellar/node/0.10.4... 5 symlinks created

IT WORKS! :-)

STEPS

brew update

brew upgrade

brew cleanup

brew install node

brew link --overwrite node

sudo chown -R $(whoami) /usr/local

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