0

I want to install yeoman which requires npm v2.1.0+.

I previously had a lower version of npm and thought when I downloaded node.js from the nodeJS site the latest npm version would be bundled with node. However, it only updated to v1.4.28.

Nodejs updated to the latest version.

I have read a lot of info advising to completely uninstall npm and then reinstall the latest version. I have tried the following;

1) I have homebrew, although I'm not sure how I originally installed npm on my Mac (Mavericks), so I thought to start with I'd try 'brew uninstall node' but got back;

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

2) I tried 'sudo npm uninstall npm -g' but got back;

sudo: npm: command not found.

Without the sudo prefix I get;

-bash: npm: command not found

3) I have tried this;

sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man

but node is still installed. Now when I check what version of npm I have I get;

-bash: npm: command not found

but it is still there!

4) I then tried to follow the advice given here; How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X) but when I do the first step

1. go to /usr/local/lib and delete any node and node_modules

I get 'permission denied' for each file (ie. a v long list of permissions denied), eg

rm: npm/.npmignore: Permission denied

I'm completely at a loss as regards how to proceed. Can anyone help? Thanks.

Community
  • 1
  • 1
Jo_
  • 73
  • 8

1 Answers1

0

This is how I resolved this (with many thanks to Raquel at npm support); by doing the above I had accidentally obliterated my npm instance and so I re-installed the latest version of Node (which brought npm back), and then upgraded npm with sudo npm i npm -g. I now have the lastest version of npm.

Jo_
  • 73
  • 8