Npm Upgrade Fails Miserably

Sep 19, 2020

All I wanted was to fix vulnerabilities reported by GitHub Dependabot, like a do twice a month or so. Which is already maddening. But instead, npm just erased itself.

New minor version of npm available! 6.13.4 → 6.14.7
Run npm install -g npm to update!

$ sudo npm install -g npm
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../../../lib/node_modules/npm/man/man1/npm-bin.1
npm ERR! dest /usr/local/share/man/man1/npm-bin.1
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../../../lib/node_modules/npm/man/man1/npm-bin.1' -> '/usr/local/share/man/man1/npm-bin.1'
npm ERR! File exists: /usr/local/share/man/man1/npm-bin.1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

$ npm ls
command not found: npm

$ which npm
npm not found

Sharing is caring!