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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@isaacs
Member

isaacs commented Sep 25, 2011

npm install --production

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

@isaacs isaacs closed this Sep 25, 2011

@kevwil

This comment has been minimized.

Show comment
Hide comment
@kevwil

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

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

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Sep 26, 2011

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@kevwil

kevwil Sep 26, 2011

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

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.