不能酿造安装节点

时间:2015-07-29 05:10:00

标签: node.js terminal install homebrew

我正在尝试通过自制程序升级我的节点,但遇到了问题因为我想我试图通过网站下载。我对终端很新。我试图搜索答案,但很多人说你可以删除未编号的头文件。我不知道该怎么做。但出于某种原因,当我尝试酿造安装节点时,它表示brew链接步骤未成功完成。

我也尝试酿造链接节点,但这也不起作用。我没有选择,所以我来到这里。

[SICNARF@WOPR ~]$ brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-0.12.7.yosemite.bottle.tar.gz
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 include/node/android-ifaddrs.h
/usr/local/include/node is not writable.

You can try again using:
  brew link node
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

当我酿造医生时会发生这种情况

[SICNARF@WOPR ~]$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
    /usr/local/include/node/ares.h
    /usr/local/include/node/ares_version.h
    /usr/local/include/node/libplatform/libplatform.h
    /usr/local/include/node/nameser.h
    /usr/local/include/node/node.h
    /usr/local/include/node/node_buffer.h
    /usr/local/include/node/node_internals.h
    /usr/local/include/node/node_object_wrap.h
    /usr/local/include/node/node_version.h
    /usr/local/include/node/openssl/aes.h
    /usr/local/include/node/openssl/asn1.h
    /usr/local/include/node/openssl/asn1_mac.h
    /usr/local/include/node/openssl/asn1t.h
    /usr/local/include/node/openssl/bio.h
    /usr/local/include/node/openssl/blowfish.h
    /usr/local/include/node/openssl/bn.h
    /usr/local/include/node/openssl/buffer.h
    /usr/local/include/node/openssl/camellia.h
    /usr/local/include/node/openssl/cast.h
    /usr/local/include/node/openssl/cmac.h
    /usr/local/include/node/openssl/cms.h
    /usr/local/include/node/openssl/comp.h
    /usr/local/include/node/openssl/conf.h
    /usr/local/include/node/openssl/conf_api.h
    /usr/local/include/node/openssl/crypto.h
    /usr/local/include/node/openssl/des.h
    /usr/local/include/node/openssl/des_old.h
    /usr/local/include/node/openssl/dh.h
    /usr/local/include/node/openssl/dsa.h
    /usr/local/include/node/openssl/dso.h
    /usr/local/include/node/openssl/dtls1.h
    /usr/local/include/node/openssl/e_os2.h
    /usr/local/include/node/openssl/ebcdic.h
    /usr/local/include/node/openssl/ec.h
    /usr/local/include/node/openssl/ecdh.h
    /usr/local/include/node/openssl/ecdsa.h
    /usr/local/include/node/openssl/engine.h
    /usr/local/include/node/openssl/err.h
    /usr/local/include/node/openssl/evp.h
    /usr/local/include/node/openssl/hmac.h
    /usr/local/include/node/openssl/idea.h
    /usr/local/include/node/openssl/krb5_asn.h
    /usr/local/include/node/openssl/kssl.h
    /usr/local/include/node/openssl/lhash.h
    /usr/local/include/node/openssl/md4.h
    /usr/local/include/node/openssl/md5.h
    /usr/local/include/node/openssl/mdc2.h
    /usr/local/include/node/openssl/modes.h
    /usr/local/include/node/openssl/obj_mac.h
    /usr/local/include/node/openssl/objects.h
    /usr/local/include/node/openssl/ocsp.h
    /usr/local/include/node/openssl/opensslconf.h
    /usr/local/include/node/openssl/opensslv.h
    /usr/local/include/node/openssl/ossl_typ.h
    /usr/local/include/node/openssl/pem.h
    /usr/local/include/node/openssl/pem2.h
    /usr/local/include/node/openssl/pkcs12.h
    /usr/local/include/node/openssl/pkcs7.h
    /usr/local/include/node/openssl/pqueue.h
    /usr/local/include/node/openssl/rand.h
    /usr/local/include/node/openssl/rc2.h
    /usr/local/include/node/openssl/rc4.h
    /usr/local/include/node/openssl/ripemd.h
    /usr/local/include/node/openssl/rsa.h
    /usr/local/include/node/openssl/safestack.h
    /usr/local/include/node/openssl/seed.h
    /usr/local/include/node/openssl/sha.h
    /usr/local/include/node/openssl/srp.h
    /usr/local/include/node/openssl/srtp.h
    /usr/local/include/node/openssl/ssl.h
    /usr/local/include/node/openssl/ssl2.h
    /usr/local/include/node/openssl/ssl23.h
    /usr/local/include/node/openssl/ssl3.h
    /usr/local/include/node/openssl/stack.h
    /usr/local/include/node/openssl/symhacks.h
    /usr/local/include/node/openssl/tls1.h
    /usr/local/include/node/openssl/ts.h
    /usr/local/include/node/openssl/txt_db.h
    /usr/local/include/node/openssl/ui.h
    /usr/local/include/node/openssl/ui_compat.h
    /usr/local/include/node/openssl/whrlpool.h
    /usr/local/include/node/openssl/x509.h
    /usr/local/include/node/openssl/x509_vfy.h
    /usr/local/include/node/openssl/x509v3.h
    /usr/local/include/node/pthread-fixes.h
    /usr/local/include/node/smalloc.h
    /usr/local/include/node/stdint-msvc2008.h
    /usr/local/include/node/tree.h
    /usr/local/include/node/uv-aix.h
    /usr/local/include/node/uv-bsd.h
    /usr/local/include/node/uv-darwin.h
    /usr/local/include/node/uv-errno.h
    /usr/local/include/node/uv-linux.h
    /usr/local/include/node/uv-sunos.h
    /usr/local/include/node/uv-threadpool.h
    /usr/local/include/node/uv-unix.h
    /usr/local/include/node/uv-version.h
    /usr/local/include/node/uv-win.h
    /usr/local/include/node/uv.h
    /usr/local/include/node/v8-debug.h
    /usr/local/include/node/v8-platform.h
    /usr/local/include/node/v8-profiler.h
    /usr/local/include/node/v8-testing.h
    /usr/local/include/node/v8-util.h
    /usr/local/include/node/v8.h
    /usr/local/include/node/v8config.h
    /usr/local/include/node/v8stdint.h
    /usr/local/include/node/zconf.h
    /usr/local/include/node/zlib.h

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
[SICNARF@WOPR ~]$ brew link
This command requires a keg argument
[SICNARF@WOPR ~]$ brew link node
Linking /usr/local/Cellar/node/0.12.7... 
Error: Could not symlink include/node/android-ifaddrs.h
/usr/local/include/node is not writable.

12 个答案:

答案 0 :(得分:23)

在同样的情况下,我遇到了同样的问题。我能够通过以下方式成功安装brew版本:

  1. 运行brew install node
  2. 记下导致问题的模块并将其删除。在您的情况下,这将是/usr/local/include/node
  3. 卸载 - brew uninstall node
  4. 重新安装 - brew install node
  5. 对于每个剩余的有问题的目录(实际上大约有3个不同的目录),我不得不重复这个过程几次,并且安装最终成功而没有任何问题。

答案 1 :(得分:16)

我在Mac OS High Sierra上的新款MacBook Pro上遇到了这个问题。我收集brew试图在/ usr / local下使用名为include和lib的目录。由于root拥有/ usr,我必须手动执行 - 确保whoami所有者匹配/ usr / local中的对等目录:

sudo mkdir /usr/local/include
chown `whoami`:admin /usr/local/include 
sudo mkdir /usr/local/lib
chown `whoami`:admin /usr/local/lib

然后匹配/ usr / local中的其他目录:

chmod 775 /usr/local/include
chmod 775 /usr/local/lib

然后以下工作:

brew uninstall node 
brew install node

答案 2 :(得分:9)

您需要使/usr/local/bin/usr/local/share可写。我使用this答案来实现这一点。以下是链接中断时复制的答案中的关键建议:

sudo chown -R `whoami`:admin /usr/local/bin
sudo chown -R `whoami`:admin /usr/local/share

答案 3 :(得分:5)

对于那些在MacOS上运行高塞拉利昂技术的人:

我尝试使用chown命令授予权限,然后先通过Homebrew卸载然后重新安装节点,但是没有任何效果。

我刚去https://nodejs.org/en/download/这个站点并下载了64位macOS .pkg,它运行良好。我通过在终端中输入命令node进行了测试。

image of which version of node to download for mac

答案 4 :(得分:5)

brew link --overwrite node

以上命令应在以下三个命令之后运行。它将解决问题。

sudo chown -R `whoami`:admin /usr/local/include/node
sudo chown -R `whoami`:admin /usr/local/bin
sudo chown -R `whoami`:admin /usr/local/share

答案 5 :(得分:3)

我的链接问题非常类似。我无法让它发挥作用。我试着chmod / usr / local / include / node所以我可以写链接但是遇到了另一个错误。作为最终解决方案,我刚从https://nodejs.org/download/

重新安装了节点

我再次有一个工作节点提示!我很想通过brew更新,但只是使用网站上的pkg安装程序,这让我省去了很多麻烦。我知道这可能不是您正在寻找的解决方案,但我只想分享我对同一问题的经验。我希望它有所帮助!

答案 6 :(得分:1)

对我来说,我必须运行brew医生,它告诉我我没有写访问权限并且必须运行sudo chown -R $(whoami) /usr/local/bin /usr/local/share /usr/local/share/man才能解决问题。

我建议运行brew doctor以查看它是否可以提供有关该问题的一些提示

答案 7 :(得分:1)

brew link --overwrite node

错误:无法符号链接(...)

/ usr / xxx

sudo chown -R 'whoami?':admin xxx
brew link --overwrite node

冲洗并重复

答案 8 :(得分:1)

brew postinstall nodebrew link --overwrite node似乎无济于事。

几轮brew uninstall nodebrew install node之后,以下是令人讨厌的目录和文件:

sudo rm -r /usr/local/include/node
sudo rm -r /usr/local/share/doc/node
sudo rm -r /usr/local/lib/node_modules
sudo rm /usr/local/lib/dtrace/node.d
sudo rm /usr/local/share/man/man1/node.1
sudo rm /usr/local/share/systemtap/tapset/node.stp

在删除有问题的文件后,brew将为您进行所有具有权限的正确链接。

由于以前使用root:wheel进行安装,或者可能是手动安装,因此权限被设置为sudo

答案 9 :(得分:0)

手动删除错误文件夹或文件,并'brew卸载节点&& brew安装节点'运行此命令

您必须执行此过程,直到删除所有错误文件夹和文件。

然后将链接该节点。

答案 10 :(得分:0)

我有同样的错误:

Linking /usr/local/Cellar/node/11.10.0...
Error: Could not symlink include/node /usr/local/include is not writable.

解决方案:

$ sudo mkdir /usr/local/include
$ sudo chown -R $(whoami) $(brew --prefix)/*
$ brew link node

链接/usr/local/Cellar/node/11.10.0 ...已创建7个符号链接

$ node -v => v11.10.0

$ npm -v => 6.7.0

答案 11 :(得分:0)

如果您尝试ID First Last 1 Jim Carrey 1 Jim Carrey 2 Liam Neeson 3 Wynona Ryder COUNT([ID]) = 4 COUNTD([ID]) results in error 并且说了一些类似的话:

  

错误:无法符号链接include / node / openssl / archs / aix-gcc / asm / include / openssl / opensslconf.h   目标/usr/local/include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslconf.h   已经存在。您可能要删除它:

尝试一下:

brew link node