Ela Ela - 4 months ago 91
Node.js Question

Node already installed, it's just not linked

I tried to fix the error where you have to use sudo when running npm. I blindly followed a link to uninstall node, the code was from this gist

After running the command and I tried to install it back with brew:

brew install node
. Which gave me the following error:

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

Trying to run
brew link node
, I got:

Linking /usr/local/Cellar/node/5.4.0...
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.

Then when I write
brew install npm
, I get:

Warning: node-5.4.0 already installed, it's just not linked

When I write
npm -v
I get:

env: node: No such file or directory

Any ideas on how to solve this?

Ela Ela

I managed to fix this by first running sudo chown -R $USER /usr/local and following it with brew link node. Now I have node properly installed.