2

I have tried the standard

brew uninstall node 

and even went to /usr/local/ to delete the files according to this post: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

I have received a bunch of error messages but when I type

node -v 

I still get v8.9.4. I can't seem to uninstall it. I'm trying to get to version v6.10.0. Now when I type brew uninstall node it gives the error

Error: No such keg: /usr/local/Cellar/node 

What more do I need to do?

1
  • Is it installed via nvm? Commented Oct 15, 2018 at 19:33

2 Answers 2

4

I recommend figuring out where your node is. To do this type:

 which node 

If you installed it via homebrew:

 brew uninstall node 

If installed via nvm

You can uninstall a specific version

 nvm ls nvm uninstall 10.4.1 

or get rid of nvm and node entirely

 rm -rf ~/.nvm 

and remove all references to NVM in your bash profile.

Sign up to request clarification or add additional context in comments.

8 Comments

Okay, I did that and did brew install node@6 it says node is installed when I check with brew but when I try to run node or try node -v I have the error of -bash: /Users/alexanderkeefe/.nvm/versions/node/v8.9.4/bin/node: No such file or directory
Try reinstalling nvm brew install nvm, you can use it to manage specific versions of node nvm install 6.0.0. You may want to source your profile again as well (close and open your terminal window).
oh, I think that helped. I also ended up going to this page nodejs.org/en/blog/release/v6.10.0 to get the installer wizard instead of doing it from the command line. Thanks so much!
No problem, I definitely recommend NVM to manage your different node versions. Cheers!
Mine is in /usr/local/bin/node
|
2

You can check out the Node installation in mac by using the below command. It will show node js version installed in your device.

node -v

Open the terminal and enter the given below command to know your current directory.

pwd

Go to your root directory.

cd /

Then enter into the usr directory by using following command.

cd usr

Go to locale directory.

cd local

Enter into include folder by using given below command.

cd include

Now if you enter the ls command then you’ll see the node folder inside the include folder like given below.

ls

node

We have to remove this node folder to completely uninstall the Node js from MacOS.

sudo rm -R node

Remove node_modules from MacOS

In next step we have to completely remove node_modules from our system.

Follow the steps

Enter the below command to go back to previous folder.

cd ..

Go to lib directory, hit the below command to enter into the lib directory.

cd lib

Use the below command to remove the node_modules (NPM) folder.

sudo rm -R node_modules

Enter the below command to come out from the directory.

cd ..

Go to bin folder using below command.

cd bin

Here you also have to delete the node folder to uninstall the Node js completely.

Enter the below command to remove the Node js from MacOS.

sudo rm -R node

Finally, we’ve successfully uninstalled the Node JS from MacOS, use the given below command to check whether the Node and NPM completely removed from our system.

node -v

We have completed our task if you are getting below output.

-bash: node: command not found

1 Comment

anyway, I've done above, I'm not sure it has been cleared entirely. . why would brew can't manage node?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.