homebrew 安装node.js报错?

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

猜你喜欢

转载自blog.csdn.net/Tan915730/article/details/86408427