npm prune --production

Category: Node.js & npm/yarn

npm prune --production

Remove devDependencies from node_modules — useful before building a Docker image

Removes devDependencies from node_modules. Run this before packaging a Docker image to strip test tools and reduce image size.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.