Used brew to install node, when checking node version, says not installed - node.js

I have tried uninstalling node with brew and reinstalling. I get a link error and when I check what version of node I have installed with node -v, it says node is not installed. What could be going on?

Related

npm is not compatible with Node.js

I had node installed in my machine and everything was working fine. During an online course made in 2019, the instructor was using an earlier version of npm (v5.5.1) and advised everyone to use the same version with him for follow up reasons. So I downgraded to v5.5.1 but now I keep getting one same error (incompatibility) for almost all commands. I read some solutions to similar problems here and even tried extra steps but the problem still persists.
I uninstalled node from my system, restarted the system and reinstalled node but the version of npm still remained v5.5.1.
I tried to uninstall npm from the command line npm uninstall -g npm but it threw incompatibility error.
I searched the web for compatible version of node.js for npm v5.5.1 and got node v10.15.1 which I downloaded installed with several system restarts but my node and npm still remain incompatible. Please what can I do?
You should use nvm which is the Node Version Manager, cURL:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
commands:
nvm install <version> Download and install a <version>
nvm use <version> Modify PATH to use <version>
nvm ls List versions (installed versions are blue)
Helpful reads:
How can the default node version be set using NVM?
How to change node version with nvm

How to get my system to use node version installed by Homebrew?

On OS X, when I run node --version I get v12.9.1. I ran brew upgrade node and it warned me Warning: node 15.3.0 already installed. I ran brew uninstall node, but then when I ran node --version I still got v12.9.1.
**What I Want To Know: **
Why does my system say that my node version is 12.9.1 when 15.30.0 is installed? How can I get it so that my system is using 15.3.0 instead of 12.9.1?

How to remove older version of Node and switch to new version?

When I node -v I get v7.10.0
I've installed with brew install node and brew upgrade node I see that 9.5 got installed.
I did brew switch node 9.5.0 and got 7 links created for /usr/local/Cellar/node/9.5.0
However when I reopen the terminal my node -v is still v7.10.0 :(
Found the answer here, I needed to remove my .nvm folder
Unable to change version of node with brew switch
First of all, check if you installed your node with nvm by check if you have a .nvm directory in home directory ls -la
if you do, remove that directory

Homebrew install of node 8 installs npm v4 instead of v5

From what I understand npm v5 should be included with node v8, like mentioned in the node release blog. However, after successfully installing node v8 via homebrew, the npm version is still 4.2.0.
I initially upgraded from node v7, but a clean install yields the same result. Running brew doctor didn't help and I can't find any open issues on either the node or homebrew projects.
Any suggestions would be appreciated.
The issue is resolved, brew install node now correctly installs npm v5 :)

"node -v" shows wrong version after "brew upgrade node"

I upgraded my version of Node.js with brew upgrade node which installed v5.3.0. But when I get the version of node with node -v it shows v0.10.29.
I tried brew link --overwrite node but that didn't work.
Brew has node linked to /usr/local/Cellar/node/0.10.29 so I went there and noticed that there are other versions of node including the version I want in /usr/local/Cellar/node/.
How do I tell brew to link node to /usr/local/Cellar/node/5.3.0 ?
Try to brew link --override node
Also see related question How to install latest version of Node using Brew.
I removed the other versions of node that I didn't want in /usr/local/Cellar/node/ and then ran :> brew unlink node && brew link node and it fixed the problem.

Resources