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

[BUG] npm@7 does not set NODE_ENV=production when --production option is used #2021

Closed
JensEggers opened this issue Oct 23, 2020 · 1 comment · Fixed by #2331
Closed

[BUG] npm@7 does not set NODE_ENV=production when --production option is used #2021

JensEggers opened this issue Oct 23, 2020 · 1 comment · Fixed by #2331
Assignees
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@JensEggers
Copy link

JensEggers commented Oct 23, 2020

Current Behavior:

The following preinstall script:

    {"preinstall": "bash -c 'echo NODE_ENV $NODE_ENV'"}

only prints:
NODE_ENV
when I run npm i --prod

Expected Behavior:

I expect it to print
NODE_ENV production

Steps To Reproduce:

  1. configure the above preinstall step in a package.json
  2. using npm@6, run npm i --prod
  3. using npm@7, run npm i --prod
  4. compare results

Environment:

  • OS: Ubuntu 20.04
  • Node: 12.16.2, npm: 6.14.8
  • Node 15.0.0, npm 7.0.3
@JensEggers JensEggers added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 23, 2020
@JensEggers
Copy link
Author

possibly related to #2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants