[npm] How to remove packages not in package.json from node_modules
To remove packages not listed in package.json from the node_modules directory, use the npm prune command.
npm prune
That’s all from the Gemba where I wanted to remove unnecessary packages from node_modules with npm prune.