1. 程式人生 > >homebrew 安裝node.js報錯?

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