[BUG] npm@7 does not set NODE_ENV=production when --production option is used (original) (raw)
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 printNODE_ENV production
Steps To Reproduce:
- configure the above preinstall step in a package.json
- using npm@6, run npm i --prod
- using npm@7, run npm i --prod
- compare results
Environment:
- OS: Ubuntu 20.04
- Node: 12.16.2, npm: 6.14.8
- Node 15.0.0, npm 7.0.3