Stuck installing node with Homebrew in MacOS: fork.rb:49:in `write': Broken pipe (Errno::EPIPE)

  • A+
Category:Languages

I am consistently getting the error below during the postinstall step when installing node in macOS Sierra.

$ 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` 

I have this version of Homebrew:

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

I uninstalled node but that didn't help.

Any suggestions?

 


I ran into the same issue today. It turned out to be an issue with permissions on /usr/local.

To change ownership of /usr/local: sudo chown -R $(whoami) $(brew --prefix)/*

Remove broken node install: brew uninstall node

Re-install node: brew install node

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: