npm dedupe throws error with npm itself

(Tiger Medina) #1

What I Wanted to Do

I was trying to remove duplicate node modules - which I suspect happened as I uninstalled and reinstalled node modules after getting previous errors

What Happened Instead

I got an error message

Reproduction Steps

Reproduction steps would be to rm -rf node_modules && npm install -g and then (I think) unnecessarily installing other modules that were installed prior to the rm -rf

Details

[command and error message]

$ npm dedupe
npm WARN rm not removing /Users/meduro/Desktop/React/react_udemy/react_tutorial_2/tutorial_2/node_modules/fsevents/node_modules/.bin/node-pre-gyp as it wasn’t installed by /Users/meduro/Desktop/React/react_udemy/react_tutorial_2/tutorial_2/node_modules/fsevents/node_modules/node-pre-gyp
(node:596) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘0’ of undefined
at rmStuff (/usr/local/lib/node_modules/npm/lib/unbuild.js:61:24)
at Array. (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
(node:596) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:596) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:

Platform Info

npm --versions
6.9.0 

node -p process.platform
darwin```
`npm dedupe` throwing an error