3

I recently installed Node on my MacBook running High Sierra 10.13 using the .pkg file supplied on their website.

After a few hours of experimenting with installing other packages and writing scripts, I decided I would like to uninstall both Node and NPM to get a fresh start. I tried all of the top answers from this thread, but to my dismay, after having followed all instructions, and repeated all steps many times, terminal would still recognise the Node and NPM versions.

I ended up running a bash script through terminal which I found on the same thread, which ended up doing nothing but downgrading my current version of Node to 0.10.8 - making it a lot more difficult to delete in the long run.

I've re-done all of the steps from the aforementioned thread with no avail, and terminal still stating that it has version 0.10.8 (and NPM just completely not working at all)

Currently at my last stance of what to do, so hopefully someone on here can help me with my problem.

Cheers.

GROVER.
  • 3,082
  • 1
  • 11
  • 48

2 Answers2

4

After searching through Google and StackOverflow for hours, I finally came up with a solution to the problem on my own.
Running the type command within terminal against node, I got this returned:

:~ myusername$ type node
node is /Users/myusername/.nvm/v0.10.48/bin/node

Subsequently, after deleting that folder, Node appears to be completely removed from my system.


I have since made sure that I have deleted all node and node_module folders that I could find within /usr/ to make sure - and I would suggest that anyone attempting this also do the same.

GROVER.
  • 3,082
  • 1
  • 11
  • 48
0

Try to run the following command

brew uninstall node

After the above command, you need to scan manually for node_modules if exists. Try following.

grep -irl "node_modules/node"

sudo rm -rf result_from_above_command
rm -rf ~/.npm

I hope this will remove all the node and it's components. As I have done like this, once before. Thank you.