Permissions denied for overriding or deleting node targets

I got a problem where every time I tried to run the npm install command I get the error: '- bash: npm: command not found' So I tried to uninstall and reinstall both node and npm using homebrew, but still confused with a few bugs. After I removed both, I ran the command: "brew doctor" and I get "Your system is ready to brew".

First I try to install node: "brew install node", but I get this:

==> Downloading https://homebrew.bintray.com/bottles/node-

0.12.7.yosemite.bottle
Already downloaded: /Library/Caches/Homebrew/node-0.12.7.yosemite.bottle.tar.gz
==> Pouring node-0.12.7.yosemite.bottle.tar.gz
==> Caveats

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 share/systemtap/tapset/node.stp
Target /usr/local/share/systemtap/tapset/node.stp
already exists. You may want to remove it:
  rm '/usr/local/share/systemtap/tapset/node.stp'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node

Possible conflicting files are:
/usr/local/share/systemtap/tapset/node.stp
/usr/local/lib/dtrace/node.d
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall node`
==> Summary
🍺  /usr/local/Cellar/node/0.12.7: 2726 files, 31M
Jamess-MacBook-Pro:~ jamesbradley$ 

      

So I'm trying to remove the target:

Jamess-MacBook-Pro:~ jamesbradley$ rm 
'/usr/local/share/systemtap/tapset/node.stp'
override rw-r--r--  root/admin for /usr/local/share/systemtap/tapset/node.stp? y
rm: /usr/local/share/systemtap/tapset/node.stp: Permission denied
Jamess-MacBook-Pro:~ jamesbradley$

      

and I get this:

rm: /usr/local/share/systemtap/tapset/node.stp: Permission denied

      

so I am trying to override and get this error:

Linking /usr/local/Cellar/node/0.12.7... 
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.
Jamess-MacBook-Pro:~ jamesbradley$ 

      

I also tried brew postinstall node and got this answer:

Error: Permission denied - /usr/local/lib/node_modules/npm
Jamess-MacBook-Pro:~ jamesbradley$ 

      

I have also tried running a number of other commands:

sudo chown -R `whoami` /Library/Caches/Homebrew/
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

      

but nothing works.

Does anyone know how I can get delete permissions and / or how to make these files writable so that I can overwrite or delete them?

+3


source to share


1 answer


Delete the folder

sudo rm -rf /usr/local/share/systemtap/

      

Remove all node installed earlier if you like.

brew uninstall node

      



Then reinstall node

brew install node

      

I had the same problem, worked for me.

+14


source







All Articles