本文介绍了Homebrew NPM安装:无法符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我犯了试图摆脱所有sudo依赖关系的错误.我从网站上以软件包的形式下载了npm,并进行了手动/全局安装.但是似乎我一直都必须使用sudo运行...所以我尝试卸载并使用自制软件运行.

So I made the mistake of trying to get rid of all sudo dependencies. I downloaded npm as a package from the site and did a manual/global install. But it seemed as if i was always having to run with sudo...so I tried to uninstall and run with homebrew.

现在,我什至无法运行node或npm……我想我必须与brew连接起来,但它们却出现了这个错误:

Now I can't get node or npm to even run...I guess I have to link with brew link them but i'm getting this error:

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'

我尝试删除它:而且我已经被拒绝了.

I've tried removing that:And i've gotten permission denied.

我尝试过运行酿造梅子.我尝试卸载,然后使用以下步骤重新安装:

I have tried running brew prune.I have tried to uninstall then reinstall using these steps:

$ brew uninstall npm
$ brew uninstall node
$ npm uninstall npm -g
$ sudo rm -rf /usr/local/lib/node_module

错误:"brew link"步骤未完成成功

我正在运行优胜美地10.10.5.我已经安装了git版本2.6.0.我的自制软件已更新.一位酿酒医生给我这个警告:

I am running Yosemite 10.10.5. I have git version 2.6.0 installed. My homebrew is updated. A brew doctor gives me this warning:

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的依赖,并大干一场.

Not sure where to go from here. I'm trying to lose my reliance on CodeKit and get gulp up and running.

推荐答案

由于您使用sudo运行了几个步骤,因此root现在似乎已经拥有/usr/local中的几个文件和目录.要摆脱这些缺陷,请夺回/usr/local下所有文件和目录的所有权:

It looks like several files and directories in /usr/local are now owned by root, since you ran a couple of steps using sudo. To get rid of these, take back ownership of all of the files and directories under /usr/local:

sudo chown -R $(whoami) $(brew --prefix)/*

完成后,再次运行brew doctor.

类似的问题可以在这里找到:

Similar questions can be found here:

  • https://apple.stackexchange.com/questions/192227/make-files-in-usr-local-writable-for-homebrew
  • Brew doctor says: "Warning: /usr/local/include isn't writable."

这篇关于Homebrew NPM安装:无法符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 12:22