简体   繁体   中英

brew fails to install node on mac os big sur

When following the usual tutorial for node installation I get the following error:

➜  ~ node
zsh: command not found: node
➜  ~ brew install node
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 1 cask.

Warning: node 15.5.1 is already installed, it's just not linked
You can use `brew link node` to link this version.
➜  ~ brew link node
Linking /usr/local/Cellar/node/15.5.1...
Error: Could not symlink include/node/cppgc/allocation.h
Target /usr/local/include/node/cppgc/allocation.h
already exists. You may want to remove it:
  rm '/usr/local/include/node/cppgc/allocation.h'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node

➜  ~ brew link --overwrite node
Linking /usr/local/Cellar/node/15.5.1...
Error: Could not symlink include/node/cppgc/allocation.h
/usr/local/include/node/cppgc is not writable.

do I need to fix permissions, and am I the only one who is currently running into it?

My case was in MacOs Big Sur 11.2.2

when i run brew install node the error output was like yours.

with the next steps i can run node perfectly:

sudo chmod -R $(whoami):admin /usr/local/inclue/node
sudo chmod -R $(whoami):admin /usr/local/share/doc/node
sudo chmod -R $(whoami):admin /usr/local/share/systemtap/tapset
sudo chmod -R $(whoami):admin /usr/local/lib/dtrace
brew link --overwrite node

hope can help you:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM