Img source:

The Problem: npm ERR! extraneous

Checking out an npm problem, I tried

$ npm list

and got the following error at the end of my listing:

npm ERR! extraneous: [email protected] /Users/flichten/repos/cg/feature-library/feature-skeleton/node_modules/karma/node_modules/chokidar/node_modules/fsevents
npm ERR! extraneous: [email protected] /Users/flichten/repos/cg/feature-library/feature-skeleton/node_modules/karma/node_modules/chokidar/node_modules/recursive-readdir
npm ERR! not ok code 0

The Explanation: Unneeded (“extraneous”) packages are installed

It seems the problem is really just a warning. NPM is saying that there are some unused, unnecessary packages installed. In most cases, this is probably an “error” that should be a warning and can therefore be ignored.

The Solution: npm prune

It’s probably safe to ignore this error. But you can clean up the unnecessary packages with

$ npm prune

Problem solved.