当前位置: 首页 > 知识库问答 >
问题:

错误:“brew链接”步骤未成功完成

鲜于裕
2023-03-14

我试图通过Homebrew安装node.js。不幸的是,我得到了这个错误:

➜  ~  brew install node
==> Downloading http://nodejs.org/dist/v0.8.10/node-v0.8.10.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/node/0.8.10
==> make install
==> Caveats
Homebrew installed npm.
We recommend prepending the following path to your PATH environment
variable to have npm-installed binaries picked up:
  /usr/local/share/npm/bin
Warning: Could not link node. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link node'
==> Summary
/usr/local/Cellar/node/0.8.10: 856 files, 13M, built in 103 seconds

然后我尝试手动链接节点...

➜  ~  brew link node
Linking /usr/local/Cellar/node/0.8.10... Warning: Could not link node. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/node/0.8.10/lib/node_modules/npm/scripts/relocate.sh
Target /usr/local/lib/node_modules/npm/scripts/relocate.sh already exists. You may need to delete it.
To force the link and delete this file, do:
  brew link -f formula_name

To list all files that would be deleted:
  brew link -n formula_name

运气不好,所以我试着强行连接节点...

➜  ~  brew link -f node
Linking /usr/local/Cellar/node/0.8.10... Warning: Could not link node. Unlinking...

Error: Permission denied - /usr/local/lib/dtrace/node.d

我对dtrace在任何方面都不熟悉,我害怕弄乱权限,所以我尝试了sudo。。

➜ ~ git:(master) sudo brew link -f node
Password:
Error: Cowardly refusing to `sudo brew link'
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.

我尝试通过brew卸载节点卸载节点并重试安装,但没有运气。

共有3个答案

柳韬
2023-03-14
sudo chown -R $(whoami) /usr/local 

就像Brew网站故障排除中提到的那样

https://github.com/Homebrew/homebrew/wiki/troubleshooting

洪成济
2023-03-14

node.js的自制软件包现在又包含了npm,所以当我错过了自制软件包关于先删除独立版本的消息时,我就遇到了这种情况。

假设,像我一样,您已经通过尝试升级破坏了节点/npm,然后才知道先卸载npm-g,您可以rm-rf /usr/local/lib/node_modules/npm,然后brew link节点。这将删除独立的自托管npm包(而不是brew想要安装的包),并让brew符号链接其从Cellar捆绑的包。

臧友樵
2023-03-14

我运行Mac OS X Mavericks。我尝试安装节点0.10.25和顶部的答案不适合我。

natevw说要rm-rf /usr/local/lib/node_modules/npm,但是如果/usr/本地/lib/node_modules上的权限是这样的:

drwxr-xr-x   3 root      admin   102 Feb  2 20:45 node_modules

然后brew将无法在该目录中创建其npm符号链接。这是我的解决方案:

$ brew update

根据您过去安装node/npm的方式,其中一些命令是不必要的。

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

注意:我有杂散的节点文件,我发现运行brew-v链接节点(这给了我连结错误brew抱怨冗长的输出)。您可能需要:

$ sudo rm -rf /usr/local/include/node
$ sudo rm -rf /usr/local/lib/node
$ brew install node
 类似资料:
  • 问题内容: 我正在尝试通过Homebrew安装node.js。不幸的是,我得到这个错误: 因此,我尝试手动链接节点… 没有运气,所以我尝试强制链接节点… 我在任何方面都不熟悉dtrace,而且害怕弄乱权限,所以我尝试sudo。 我尝试通过卸载节点,然后重试安装,但是没有运气。 问题答案: 现在,用于node.js的Homebrew软件包再次包含了npm,因此,当我错过了homebrew软件包中有关

  • 我今天将我的serenity和cucumber测试升级到2.6.0 en cucumber 6版本。只需要更改大量程序包,并且功能文件的步骤不再链接到步骤定义。如果我的cucumberrunner的设置 但是,如果我在功能文件中查看intellij,您将无法再单击步骤以转到定义。当我运行功能文件时,我会得到以下异常: 我不确定是什么地方出了问题,因为相同的代码适用于以前的版本

  • 希望这里有人能给我指明正确的方向。 谢谢!

  • 我正在尝试将方法的调用/结果链接到下一个调用。我得到了编译时错误方法,因为if无法从前一次调用中获得objB的引用。 如何将上一次调用的结果传递给下一个链?我是不是完全误解了这个过程?

  • 我已经使用Passkit框架在我的iOS应用程序中实现了apple pay。为了建立apple Pay,我做了所有这些事情。我在用沙箱帐户。我在钱包应用程序中添加了卡,这些卡是我从这个链接复制的测试卡。我正在使用的代码: 我正在使用的所有委托: Apple pay viewcontroller正在显示,此屏幕显示的是一个处理圆视图。 但几秒钟后,我收到了这个错误消息:

  • 我已经配置了我的 REST/Spring/Jersey 项目,以使用 enunciate 为 API 生成文档。 我的pom中的相关变化。xml是 我的发音。xml如下 当我运行我的maven项目时,我收到以下初始化发音错误。正如您所看到的,错误不是很有帮助。任何提示我的配置中可能有什么错误。 --- maven-enunciate-spring-plugin:1.28:assemble (def