GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Perhaps I'm just missing something, but using "npm install" on a production server still brings in dependencies listed as devDependencies. It would be great to have an option to skip devDependencies when using "npm install".
npm install --production
I'm confused. Should NODE_ENV be set to "production" before running "npm install", or is "--production" a new arg to "npm install"? Both? Please clarify.
If you do npm config set production, then that sets the --production configuration flag for all npm commands, by setting production = true in the ~/.npmrc file.
npm config set production
production = true
If you do npm start --production, then it'll set the NODE_ENV=production environ for the start script.
npm start --production
If you do npm install --production then it won't install devDependencies locally.
Thank you! Very clear, now I get it. :)