'NPM prune after NPM ci

I have an innocent question :is there some interest to do a npm prune after a npm ci ? For me npm ci seems to be sufficient, no ?

Thanks by advance



Solution 1:[1]

since 'npm ci' removes the existing 'node_modules' before installing, there is no need to prune.

Npm prune removes extraneous packages installed inside your node_modules folder that aren't defined inside the package.json. This can not happen when you go from an empty node_modules folder.

Solution 2:[2]

but this is not valid answer of @madmed as of now, because after npm prune I have:

added 410 packages, removed 984 packages, and changed 10 packages in 32s

but npm ci desn't changes package-lock.json

So answer is: Yes you have interest. And I done it in my project to be sure that root package-lock.json was updated after my changes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Michael Gaev