Is an "extraneous" module anything bad?

Continua la discussione da npm install installs extraneous deps:

Is it just for info to the user or is it something that is supposed to be fixed?
Is it normal for a project to have extraneous packages?
Is it just a naming for dependencies of direct dependencies?

With that naming feels like something is wrong. :man_shrugging: (external? rather than extraneous, that feels like “out of place”).


In normal operation with package-locks enabled, extraneous modules are pruned automatically when modules are installed and you’ll only need this command with the --production flag.

Why would them need to be removed?
A dependency of a direct package.json-dependency should be legit.
Why discriminate it as extraneous and as to-be-pruned?

In my case I get extraneous on a indirect dependency, that is installed (via --global-style) because of a direct dependency.

RepoA package.json has a dependency { "custom-repoB": "https://github..../repoB", ...}.
RepoB package.json has a dependency { "custom-repoC": "https://github..../repoC" }.
(RepoB and RepoC were intentionally not published on NPM registry)
When running npm install --global-style then the RepoC is marked as extraneous :man_shrugging:

extraneous means there is a package in your node_modules folder which is not a dependency directly or indirectly from your package.json.

It is not normal.

(From looking at one of your other topics, I wonder if custom-repoC is not the package name as specified in reboC. But that is a guess!)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.