Trying to update to latest NPM version but existence of npx is blocking it

Viewed 432

I would like to update to the latest npm version on a mac, so of course I ran

npm install -g npm@latest

but I got the following error message

rm not removing /usr/local/bin/npm as it wasn't installed by /usr/local/lib/node_modules/npm
npm WARN rm not removing /usr/local/bin/npx as it wasn't installed by /usr/local/lib/node_modules/npm
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/npm/bin/npx-cli.js
npm ERR! dest /usr/local/bin/npx
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/npm/bin/npx-cli.js' -> '/usr/local/bin/npx'
npm ERR! File exists: /usr/local/bin/npx
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

Ok, I would like to not run --force to overwrite files recklessly - so how do I get npm to install the latest version in this case?

0 Answers
Related