So I installed a new package from NPM, which went well, and after that I got the usual notice from NPM that an update was available:
+ redis-commander@0.7.0
added 499 packages from 309 contributors in 41.457s
╭────────────────────────────────────────────────────────────────╮
│ │
│ New patch version of npm available! 6.14.5 → 6.14.8 │
│ Changelog: https://github.com/npm/cli/releases/tag/v6.14.8 │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯
so I proceeded to run npm install -g npm
and it broken down with the following error:
npm ERR! code EACCES
npm ERR! syscall unlink
npm ERR! path /usr/local/lib/node_modules/.npm.DELETE/tap-snapshots/test-tap-fund.js-TAP.test.js
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/.npm.DELETE/tap-snapshots/test-tap-fund.js-TAP.test.js'
npm ERR! [OperationalError: EACCES: permission denied, unlink '/usr/local/lib/node_modules/.npm.DELETE/tap-snapshots/test-tap-fund.js-TAP.test.js'] {
npm ERR! cause: [Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/.npm.DELETE/tap-snapshots/test-tap-fund.js-TAP.test.js'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/usr/local/lib/node_modules/.npm.DELETE/tap-snapshots/test-tap-fund.js-TAP.test.js'
npm ERR! },
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/usr/local/lib/node_modules/.npm.DELETE/tap-snapshots/test-tap-fund.js-TAP.test.js'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/julien/.npm/_logs/2020-09-29T01_04_10_380Z-debug.log
I tried to run it again and now the system says it cannot be found:
$ npm install -g npm
-bash: /usr/local/bin/npm: No such file or directory
Furthermore:
$ which node
/usr/local/bin/node
$ which npm
$
What happened and most importantly, how do I solve this mess?
Note: MacOS Catalina (10.15.5)