title: Permissions denied to override or delete node targets
body: <p>I've been running into an issue where every time I've attempted to run an npm install command I receive an error: '-bash: npm: command not found'
  So I've attempted to uninstall and reinstall both node and npm using homebrew, but still running into a few errors. After I've uninstalled both, I have run the command: "brew doctor" and I get "Your system is ready to brew."</p>
  
  <p>First I attempt to install node: "brew install node", but I get the following: </p>
  
  <pre><code>==&gt; 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
  ==&gt; Pouring node-0.12.7.yosemite.bottle.tar.gz
  ==&gt; 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`
  ==&gt; Summary
    /usr/local/Cellar/node/0.12.7: 2726 files, 31M
  Jamess-MacBook-Pro:~ jamesbradley$ 
  </code></pre>
  
  <p>So then I attempt to remove the target:</p>
  
  <pre><code>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$
  </code></pre>
  
  <p>and I get the following: </p>
  
  <pre><code>rm: /usr/local/share/systemtap/tapset/node.stp: Permission denied
  </code></pre>
  
  <p>so then I attempt to override and I get this error:</p>
  
  <pre><code>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$ 
  </code></pre>
  
  <p>I've also attempted to brew postinstall node and I get this response: </p>
  
  <pre><code>Error: Permission denied - /usr/local/lib/node_modules/npm
  Jamess-MacBook-Pro:~ jamesbradley$ 
  </code></pre>
  
  <p>I've also attempted to run a number of other commands:</p>
  
  <pre><code>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 &amp;&amp; brew cleanup
  </code></pre>
  
  <p>but nothing seems to be working. </p>
  
  <p>Does anyone know how I can obtain permissions to delete and/or how to make these files writable so I can either overwrite or delete them?</p>