Update to 10.0.0 breaks existing env-cmd npm scripts
See original GitHub issueHi,
I am using env-cmd in versin 9.0.3 and greenkeeper just got me the update in. I tried it out and the command just fail with sh: line 1: 4041 Terminated: 15. I checked the changelogs but cannot find any breaking change affecting me, since I use vanilla NodeJS 12.8.1.
An example command as I have it in my package.json:
env-cmd cross-env DEBUG=false KNEX_SEED_DIR=./seeds/resetdb knex seed:run
I need to use the default .env file within my system and then override some env vars with cross-env. I would guess something about parsing this line has changed.
Maybe you can help me either “rewrite” the script so that I actually do not need both env-cmd and cross-env, or we find the bug breaking my script in the latest update.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
env-cmd | Yarn - Package Manager
A simple node program for executing commands using an environment from an env file. Install. npm install env-cmd or npm install -g env-cmd...
Read more >scripts - npm Docs
How npm handles the "scripts" field. ... It is run AFTER the changes have been applied and the package.json and package-lock.json files have...
Read more >env-cmd - npm
Executes a command using the environment variables in an env file. Latest version: 10.1.0, last published: 3 years ago. Start using env-cmd ......
Read more >isml-linter - npm
ISML Linter is a tool for examining if your project's templates follow a specified set of rules defined by your dev team. The...
Read more >@wordpress/scripts - npm
To update an existing project to a new version of ... keeping the breaking changes minimal so you can upgrade @wordpress/scripts as seamless ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ah gotcha, that would be a pain then. The other solution is an
.env-cmdrcfile with multiple environments. If you cannot use a.rcfile then you are out of luck at this time.With a
.rcfile you could create one environment calledsharedwith common environment vars, then three other environments for each of those other scripts. Then something likeenv-cmd -e shared,environment1 .... That way you get the benefit of shared env vars and overriding/merging of the environments together.Glad to hear it is working. Sorry about the breakage! I had forgotten to run it through my
env-cmd-examplesrepo before releasing 🤦♂The new version works! Thanks 💯
Regarding my problem: I see what you mean, but I have several scripts and each of them would require a special env file then:
And in production my env vars cme from the k8s cluster. So I do not even have env-cmd there any more.
Thanks a lot for this package, we really love it https://retraced.co/ And thanks for the quick update 👍