CF Node.js buildpack -- support for disabling "production" flag when running `npm install`

138 views
Skip to first unread message

sven...@gmail.com

unread,
Apr 17, 2015, 10:13:07 AM4/17/15
to vcap...@cloudfoundry.org
Hey All,

Currently, when installing the dependencies for a user's Node app, we run this command:
  npm install --userconfig $build_dir/.npmrc --production 2>&1 | indent

Seems that it would be valuable to give users the option to disable the "--production" flag so that their "devDependencies" in package.json can be installed.  One use case is for developers who want their grunt dependencies installed on production, but it's a hassle because those dependencies are generally under "devDependencies":
https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt/issues/5 and
http://stackoverflow.com/questions/22954782/install-devdependencies-on-heroku

Heroku supports this functionality via NPM_CONFIG_PRODUCTION; from their buildpack docs on GitHub:

To install dependencies and devDependencies:

heroku config:set NPM_CONFIG_PRODUCTION=false

Default: NPM_CONFIG_PRODUCTION defaults to true on Heroku

I'd be happy to open a PR to include this support!

Thanks,
Sai

Mike Dalessio

unread,
Apr 17, 2015, 10:26:39 AM4/17/15
to vcap...@cloudfoundry.org
Hi Sai,

Thanks for asking this question. I see that you also opened a Github issue for this:


Let's move the conversation there!

Cheers,
-m


--
You received this message because you are subscribed to the Google Groups "Cloud Foundry Developers" group.
To view this discussion on the web visit https://groups.google.com/a/cloudfoundry.org/d/msgid/vcap-dev/19041b4c-05c1-42fa-95c5-d013807a8530%40cloudfoundry.org.

To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.

Reply all
Reply to author
Forward
0 new messages