错误:“酿造链接"步骤未成功完成 [英] Error: The 'brew link' step did not complete successfully

查看:23
本文介绍了错误:“酿造链接"步骤未成功完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 Homebrew 安装 node.js.不幸的是,我收到此错误:

I'm trying to install node.js via Homebrew. Unfortunately, I get this error:

➜  ~  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

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

So then I try to link node manually...

➜  ~  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

运气不好,所以我尝试强行链接节点...

No luck, so I try forcefully linking node...

➜  ~  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..

I'm not familiar with dtrace in any regard and I'm afraid to mess with permissions, so I tried to 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 uninstall node 卸载节点,然后重试安装,但没有成功.

I've tried uninstalling node via brew uninstall node and retrying the install with no luck.

推荐答案

node.js 的 homebrew 包现在再次包含 npm,所以当我错过 homebrew 包关于首先删除独立版本的消息时,这发生在我身上.

The homebrew package for node.js now includes npm again, so this happened to me when I missed the homebrew package's message about removing the standalone version first.

假设你和我一样,在知道 npm uninstall npm -g 之前已经尝试升级破坏了 node/npm,你可以 rm -rf/usr/local/lib/node_modules/npm 然后是 brew link node.这将删除 standalone 自托管的 npm 包(而不是 brew 想要安装的),并让 brew 符号链接其从 Cellar 中捆绑的包.

Assuming, like me, you've already broken node/npm by attempting the upgrade before knowing to npm uninstall npm -g first, you can rm -rf /usr/local/lib/node_modules/npm and then brew link node. This removes the standalone self-hosted npm package (rather than the one brew would like to install) and lets brew symlink its bundled one from Cellar.

这篇关于错误:“酿造链接"步骤未成功完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆