【发布时间】:2015-12-27 06:34:47
【问题描述】:
所以我犯了一个错误,试图摆脱所有 sudo 依赖项。我从站点下载了 npm 作为一个包并进行了手动/全局安装。但似乎我总是不得不使用 sudo 运行......所以我尝试卸载并使用自制软件运行。
现在我什至无法让 node 或 npm 运行...我想我必须用 brew link 链接它们,但我收到了这个错误:
Could not symlink share/doc/node/gdbinit
Target /usr/local/share/doc/node/gdbinit
already exists. You may want to remove it:
rm '/usr/local/share/doc/node/gdbinit'
我试过删除它: 而且我的权限被拒绝了。
我尝试过运行 brew prune。 我尝试使用以下步骤卸载然后重新安装:
$ brew uninstall npm
$ brew uninstall node
$ npm uninstall npm -g
$ sudo rm -rf /usr/local/lib/node_module
Error: The 'brew link' step did not complete successfully
我正在运行 Yosemite 10.10.5。我安装了 git 版本 2.6.0。我的自制软件已更新。一位酿酒医生给了我这个警告:
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
node
不知道从这里去哪里。我正在努力摆脱对 CodeKit 的依赖,开始大吃一惊。
【问题讨论】:
-
I've tried removing that: And i've gotten permission denied.- 那是因为您首先以 root 身份安装。现在您必须使用sudo rm '/usr/local/share/doc/node/gdbinit'删除。注意:如果您使用自制软件,请不要再将带有sudo install的任何内容安装到 /usr/local。这将造成巨大的混乱。 -
现在我得到'could not symlink share/system/systemtap/tapset/node.stp /usr/local/share/system/tapset is not writable。我试过做一个 sudo chown -R 'username'/usr/local/share/system/tapset 但这没有用。
-
我会简单地删除所有冲突文件。这有点古怪,但这就是为什么我们有很棒的包管理器,比如 hombrew。手动卸载实在是太痛苦了。
-
如您所知,我是使用命令行安装删除文件的新手......我是否必须一一尝试删除冲突文件? Homebrew 确实有一个命令说它会覆盖节点文件,但它似乎没有解决问题。