Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac -bash: node: command not found

I am having problems running node.js from the terminal.

I have run the node.js installer for mac, but when I try to use the node command in the terminal, I get the following error:

-bash: node: command not found

I have been trying to look for a solution but all the suggestions I found, dont help

In the folder /usr/local/bin I have node and npm, but even when I navigate to the folder and run node, I still get the same error. I don't understand why this is happening, because I can see that node exists in the folder.

I also tried to edit the .bash_profile by adding /usr/local/bin but that didn't resolve the issue either

Any suggestions would be greatly appreciated! TIA!

like image 928
Ronny vdb Avatar asked May 26 '15 19:05

Ronny vdb


People also ask

How do I check if node is installed Mac?

To see if Node is installed, type node -v in Terminal. This should print the version number so you'll see something like this v0.

How do I enable node installed?

To change Node. JS versions, we have to first download the version we want. Make sure you have nvm installed first. If you don't know the version you want to install, type nvm ls-remote to get a full list of all installable Node.


1 Answers

brew search node 

then brew install node@version, example:

brew install node@8

brew link node@8
node --version

Still getting node not found, try this:

brew link --overwrite --force node@8
like image 144
Prutha Nagrikar Avatar answered Oct 24 '22 13:10

Prutha Nagrikar