被拒绝覆盖或删除节点目标的权限

Jam*_*ley 3 npm osx-yosemite

我一直遇到一个问题,每次我试图运行npm install命令时都会收到错误:'-bash:npm:command not found'所以我试图卸载并重新安装节点和npm使用自制软件,但仍然遇到一些错误.在我卸载了两个之后,我运行了命令:"brew doctor",我得到"你的系统已准备好酿造".

首先我尝试安装节点:"brew install node",但我得到以下内容:

==> 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$ 
Run Code Online (Sandbox Code Playgroud)

那么我试图删除目标:

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$
Run Code Online (Sandbox Code Playgroud)

我得到以下内容:

rm: /usr/local/share/systemtap/tapset/node.stp: Permission denied
Run Code Online (Sandbox Code Playgroud)

所以然后我试图覆盖,我得到这个错误:

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$ 
Run Code Online (Sandbox Code Playgroud)

我也试图酿造postinstall节点,我收到了这个回复:

Error: Permission denied - /usr/local/lib/node_modules/npm
Jamess-MacBook-Pro:~ jamesbradley$ 
Run Code Online (Sandbox Code Playgroud)

我还试图运行其他一些命令:

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
Run Code Online (Sandbox Code Playgroud)

但似乎没有任何工作.

有谁知道我如何获得删除权限和/或如何使这些文件可写,所以我可以覆盖或删除它们?

Mai*_*lpt 14

删除文件夹

sudo rm -rf /usr/local/share/systemtap/
Run Code Online (Sandbox Code Playgroud)

如果需要,删除先前安装的所有节点.

brew uninstall node
Run Code Online (Sandbox Code Playgroud)

然后重新安装节点

brew install node
Run Code Online (Sandbox Code Playgroud)

我有同样的问题,为我工作.