0

I'm on Mac OS X (High Sierra). I'm having trouble upgrading npm. From their docs, I ran

localhost:tmp davea$ npm install -g npm@latest
/usr/local/Cellar/node@8/8.16.1/bin/npm -> /usr/local/Cellar/node@8/8.16.1/lib/node_modules/npm/bin/npm-cli.js
/usr/local/Cellar/node@8/8.16.1/bin/npx -> /usr/local/Cellar/node@8/8.16.1/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.11.3
updated 1 package in 6.56s

but when I check the version, it is still at 6.9.0

localhost:tmp davea$ npm -v
6.9.0

What's going on?

Dave
  • 15,639
  • 133
  • 442
  • 830

1 Answers1

0

You are looking at the npm version which is different to the node version.

If you look at the releases from nodejs.org you can see which version of npm your version of node relates to.

If you type node -v you'll see your Node version. 8.6.1 relates to npm version 6.4.1.

npm version 6.9.1 was released with node version 10.16.0

I would highly recommend using nvm on OSX to take the stress out of it. You can find it here.

Also, try looking at this answer.

malfunction
  • 71
  • 2
  • 5
  • I'm speculating here but your node version may only support up to npm version 6.9.0 and that may be why an update doesn't seem to do anything. – malfunction Sep 25 '19 at 22:55
  • "node -v" gives 10.16.3. This won't allow me to upgrade to the latest npm? – Dave Sep 25 '19 at 23:05
  • It looks that way from the specified version for 10.16.3, yes, but it is the latest version of npm for that node version so it's as updated as it can be. 12.7 and up use npm version 6.10.x. – malfunction Sep 25 '19 at 23:58