What does --only=dev mean in package.json?

Viewed 804

"cd client && npm install --only=dev && npm install && npm run build"

  • What does --only=dev mean in package.json.
  • How does its absence affect the code?
1 Answers

This controls whether development or production dependencies (and not both) are installed, as seen here:

The --only={prod[uction]|dev[elopment]} argument will cause either only devDependencies or only non-devDependencies to be installed regardless of the NODE_ENV.
Related