gpt4 book ai didi

node.js - 在 MacOS 中使用 Homebrew 安装 Node 时卡住:fork.rb:49:in `write' : 管道损坏 (Errno::EPIPE)

转载 作者:太空宇宙 更新时间:2023-11-03 22:40:42 24 4
gpt4 key购买 nike

在 macOS Sierra 中安装 Node 时,我在安装后步骤中始终收到以下错误。

$ brew postinstall node --verbose
==> Postinstalling node
/usr/bin/sandbox-exec -f /private/tmp/homebrew20180915-55177-tjsmxe.sb nice /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/x86_64-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/universal-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/universal-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/x86_64-darwin9.0:/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/universal-darwin9.0:/usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/postinstall.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node.rb --verbose
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `write': Broken pipe (Errno::EPIPE)
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `puts'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `rescue in block (3 levels) in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:31:in `block (3 levels) in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `block (2 levels) in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `open'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `block in safe_fork'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:in `safe_fork'
from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:886:in `post_install'
from /usr/local/Homebrew/Library/Homebrew/cmd/postinstall.rb:14:in `block in postinstall'
from /usr/local/Homebrew/Library/Homebrew/cmd/postinstall.rb:11:in `each'
from /usr/local/Homebrew/Library/Homebrew/cmd/postinstall.rb:11:in `postinstall'
from /usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall node`

我有这个版本的 Homebrew:

Homebrew 1.7.4
Homebrew/homebrew-core (git revision a216b; last commit 2018-09-15)

我卸载了 Node ,但这没有帮助。

有什么建议吗?

最佳答案

我今天也遇到了同样的问题。原来是/usr/local 上的权限问题。

要更改/usr/local 的所有权:sudo chown -R $(whoami) $(brew --prefix)/*

删除损坏的 Node 安装:brew uninstall node

重新安装 Node :brew install node

关于node.js - 在 MacOS 中使用 Homebrew 安装 Node 时卡住:fork.rb:49:in `write' : 管道损坏 (Errno::EPIPE),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52350476/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com