npm install --[[devDepsOnly]]
npm prune --production
See also #4791 for a previous whack at this.
This issue seems that has already resolved...?
This was implemented by @bengl as npm install --only=dev for his own nefarious purposes in npm@3. 🎉 Y'all shipped a thing without us! Thanks to all for their patience, and to @bengl for implementing this!
npm install --only=dev