Home > OS >  How to uninstall node.js 10.x and npm 6.x.x from macos?
How to uninstall node.js 10.x and npm 6.x.x from macos?

Time:01-27

I have an old version of node v10.4.1 and npm 6.4.1 running my Mac and want to install the newest NPM 9.

I tried to

npm install -g npm@9

and to install the .pkg file from the website.

Everytime I check the version via shell

$ npm -v
6.4.1

Then I tried to uninstall all NPM versions via

sudo npm uninstall npm -g

and manually like described here npm uninstall not working in Mac terminal

Nothing works so far. I.e. this is shown

$ npm -v
6.4.1

How can I make sure everything is cleanly uninstalled?

CodePudding user response:

After 2 hours of fiddling with this I accidently typed in

$ npm -b

And this dir came up

/usr/local/Cellar/node@10

After deleting that folder, I found this as well

/usr/local/opt/node@10

and deleted it as well.

Afterwards I simply used this again

$ npm install -g npm@9

and ppooff. It shows me after a shell restart

$ npm -v
9.3.1
$ node -v
v18.13.0

I hope that saves u some time and nerve.

  • Related