homebrew 安装node.js报错?

本文详细记录了在Mac环境下使用Homebrew安装Node.js过程中遇到的权限错误及解决方案,包括卸载、更新、重新安装及特殊权限设置等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mac$ brew install node

==> Downloading https://homebrew.bintray.com/bottles/node-11.6.0.mojave.bottle.t

Already downloaded: /Users/mac/Library/Caches/Homebrew/downloads/c236c1678678b19d98f3f03fe51f03439db374e8ef64246eb172ced8615d2911--node-11.6.0.mojave.bottle.tar.gz

==> Pouring node-11.6.0.mojave.bottle.tar.gz

Error: The `brew link` step did not complete successfully

The formula built, but is not symlinked into /usr/local

Could not symlink share/doc/node/gdbinit

/usr/local/share/doc/node is not writable.

 

You can try again using:

  brew link node

因为之前安装过,删除之后再安装出现error。

解决办法:

sudo brew uninstall node(或brew uninstall node)

brew update

brew upgrade

brew cleanup

brew install node

sudo chown -R $(whoami) $(brew --prefix)

brew link --overwrite node

brew postinstall node

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值