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 :)
So, brew isn't really working for me, it keeps giving me these errors. When I tried to re-install it, it gave me this:
virtu0us:~ lik20$ brew install node
Updating Homebrew...
Warning: node 14.5.0 is already installed, it's just not linked
You can use `brew link node` to link this version.
So when I tried to do that,
virtu0us:~ lik20$ brew install node
Updating Homebrew...
Warning: node 14.5.0 is already installed, it's just not linked
You can use `brew link node` to link this version.
virtu0us:~ lik20$ brew link node
Linking /usr/local/Cellar/node/14.5.0...
Error: Could not symlink include/node/common.gypi
Target /usr/local/include/node/common.gypi
already exists. You may want to remove it:
rm '/usr/local/include/node/common.gypi'
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
So I did this:
virtu0us:~ lik20$ brew link node
Linking /usr/local/Cellar/node/14.5.0...
Error: Could not symlink include/node/common.gypi
Target /usr/local/include/node/common.gypi
already exists. You may want to remove it:
rm '/usr/local/include/node/common.gypi'
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
virtu0us:~ lik20$ brew link --overwrite node
Linking /usr/local/Cellar/node/14.5.0...
Error: Could not symlink include/node/common.gypi
/usr/local/include/node is not writable.
Is there a way I can fix this?
I am trying to run the command
brew install node
and getting the warning:
node 12.12.0 is already installed, it's just not linked
You can use `brew link node` to link this version.
When running brew link node, I get the error
Error: Could not symlink include/node/common.gypi
Target /usr/local/include/node/common.gypi
already exists. You may want to remove it:
rm '/usr/local/include/node/common.gypi'
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
Next, I ran rm '/usr/local/include/node/common.gypi'
and it asks
override rw-r--r-- root/wheel for /usr/local/include/node/common.gypi?
When typing y
it says
rm: /usr/local/include/node/common.gypi: Permission denied
How do I fix the problem with the installation?
Thanks
I assume that you are using Mac.
try
sudo rm: /usr/local/include/node/common.gypi
Also add node PATH to your environment variables.
I met an error while doing "brew cleanup":
$ brew cleanup
Warning: Skipping opam: most recent version 2.0.3 not installed
Warning: Skipping python: most recent version 3.7.2_2 not installed
Warning: Skipping sqlite: most recent version 3.27.1 not installed
Error: Permission denied # unlink_internal - /usr/local/lib/node_modules/#angular/cli/node_modules/.bin/in-install
Does anyone know how to fix this?
PS: brew link node returns an error, though I don't know if it is related.
$ brew install node
Warning: node 11.9.0 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/11.9.0...
Error: Could not symlink include/node/common.gypi
Target /usr/local/include/node/common.gypi
already exists. You may want to remove it:
rm '/usr/local/include/node/common.gypi'
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
First fix permissions causing the error:
sudo chown -R "$(whoami)":admin /usr/local
On macOS Mojave, the chown command needs to be run on the specific directory, an example for the permissions issue in /usr/local/lib directory, this command would be
sudo chown -R "$(whoami)":admin /usr/local/lib
Then relink node with the --force option as directed:
brew link --overwrite node
This worked for me:
brew unlink node && brew link node
I've literally searched everything on web. But I could not find the solution for the error node-0.8.8 already installed, it's just not linked. Is it related to a path file issue?
Execute this list of commands in this particular order:
sudo 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
After you've run brew upgrade to update node to the latest version, run brew doctor to see what potential problems there are. It might tell you that node is unlinked, in which case, running brew link node will link it. (You might need to first run brew unlink node)
I got the same error today and it told me that Node was not properly linked and there were unexpected header files as well.
When I tried to reinstall node, It told me that it was already installed, just not linked.
Warning: /usr/local/include isn't writable
/usr/local/bin/node already exists. Remove it
Solution
To fix this, I took ownership of it by using:
sudo chown -R `whoami` /usr/local/
Then I force linked all files by using:
brew link --overwrite node
After that I did the post install routine with:
brew postinstall node
Then I checked if node was properly installed with:
node -v
I received output v5.1.0 and It was fixed :). Hope this helps.
This may not be the perfect fix out there since I have started dabbling with node and homebrew just 10 minutes ago but it did the job for me.
Your old version of Node 0.5 was probably not installed with Homebrew (or Homebrew's script changed in the large gap between the 0.5 beta releases to the 0.8 stable releases (the 0.6 and 0.7 releases in-between).
Both Homebrew and the official Node installer try to install to /usr/local/bin so I'd recommend starting by simply deleting /usr/local/bin/node, /usr/local/bin/npm, and /usr/local/lib/node and try again.
hardcorepunk's answer worked. However, we can no longer chown /usr/local in High Sierra. So, execute the commands in this order:
sudo 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
To link the node, run following command:
brew link homebrew/versions/node<version no>
And to check whether it is properly installed or not, run:
node -v
If node will get properly linked, it will not through any error, and will print node version. You can read nice explanation about it from here.
For line did the job:
brew link --overwrite node
It forces the link and overwrite all conflicting files:
You can change the permission of the file "/usr/local/bin/node", like "chmod +w /usr/local/bin/node", to make it writable.