Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devDependencies are not installed when both NODE_ENV=production and NPM_CONFIG_PRODUCTION=false are set #1975

Closed
joeyespo opened this issue Nov 21, 2016 · 5 comments · Fixed by #2057

Comments

@joeyespo
Copy link
Contributor

Do you want to request a feature or report a bug?
bug

What is the current behavior?

NODE_ENV seems to be taking precedence over NPM_CONFIG_PRODUCTION (and YARN_PRODUCTION).

In npm, it's the opposite.

If the current behavior is a bug, please provide the steps to reproduce.

$ yarn init -y
$ yarn add Base64
$ yarn add --dev blob
$ rm -rf node_modules
$ NODE_ENV=production NPM_CONFIG_PRODUCTION=false yarn

This doesn't install blob.

What is the expected behavior?

It should install devDependencies like npm does:

$ yarn init -y
$ yarn add Base64
$ yarn add --dev blob
$ rm -rf node_modules
$ NODE_ENV=production NPM_CONFIG_PRODUCTION=false npm install

This does install blob.

Please mention your node.js, yarn and operating system version.

$ node -v
v6.3.1

$ npm -v
3.10.3

$ yarn -V
0.17.8

Windows 10

@adamreisnz
Copy link

@joeyespo

(and YARN_PRODUCTION)

Is that a real thing? I didn't come across it in any documentation, and Googling for it is nearly impossible due to the articles about yarn production that show up...

@joeyespo
Copy link
Contributor Author

@adamreisnz Yeah, it's the same deal with NPM_CONFIG_. It's a prefix that you can use to specify any of the npm options. YARN_ is the Yarn-equivalent, with NPM_CONFIG_ for backwards-compatibility. So it doesn't really show up in any searches. (I figured this out after digging around a while.)

@adamreisnz
Copy link

adamreisnz commented Dec 17, 2016

Ok thanks, I'll give it a go. Might be useful for my issue where I want to install only prod dependencies, yet have NODE_ENV set to something else, like staging.

Edit ok it's not useful after all, as it overwrites NODE_ENV to production.

@bestander
Copy link
Member

bestander commented Dec 17, 2016 via email

@itaysabato
Copy link

This issue is blocking me from migrating to yarn. When can we expect a release including the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants