Skip to content
This repository has been archived by the owner. It is now read-only.

option to not install devDependencies #1434

Closed
kevwil opened this issue Sep 20, 2011 · 4 comments
Closed

option to not install devDependencies #1434

kevwil opened this issue Sep 20, 2011 · 4 comments

Comments

@kevwil
Copy link

@kevwil kevwil commented Sep 20, 2011

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".

@isaacs
Copy link
Member

@isaacs isaacs commented Sep 25, 2011

npm install --production

http://npmjs.org/doc/config.html#production

@isaacs isaacs closed this Sep 25, 2011
@kevwil
Copy link
Author

@kevwil kevwil commented Sep 26, 2011

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.

@isaacs
Copy link
Member

@isaacs isaacs commented Sep 26, 2011

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.

If you do npm start --production, then it'll set the NODE_ENV=production environ for the start script.

If you do npm install --production then it won't install devDependencies locally.

@kevwil
Copy link
Author

@kevwil kevwil commented Sep 26, 2011

Thank you! Very clear, now I get it. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.