2

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?

Macilias
  • 3,279
  • 2
  • 31
  • 43
  • Have you tried to `brew uninstall node` and then `brew install node` ? – filippofilip Jan 12 '21 at 14:32
  • 2
    Yes I did, but it didnt help, but to solve it, I followed the steps to fix brew described here: https://stackoverflow.com/questions/32849741/homebrew-npm-install-could-not-symlink/32942618 – Macilias Jan 12 '21 at 14:35
  • Try `rm '/usr/local/include/node/cppgc/allocation.h'` as specified in the error message, then retry to link node with `brew link node` – Edouard Courty Jan 12 '21 at 15:12

1 Answers1

1

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 :)

  • right now I have brew up and running so I don't want to experiment with it ;) but next time I'm in trouble with it I'll try your suggestion and validate. Maybe someone else with same problem can provide some insights wether it helped or not. Thanks! – Macilias Jun 01 '21 at 14:54