-
Notifications
You must be signed in to change notification settings - Fork 247
cross-env version 5.0.0 no longer seems to replace environment variables #125
Comments
Hi 👋 Please use cross-env-shell for this. See the README. 👍 Good luck! |
Thanks for pointing me to cross-env-shell. FWIW, I read the README and saw that there was a new cross-env-shell command prior to opening this issue, but the description didn't seem to match my usage scenario and so it wasn't immediately clear it could be used in this way. For example, the README states:
Since I was only using a single command in my example (i.e. "echo") and was trying to substitute environment variables set for the process running npm rather than an individual script command, the description and example provided didn't seem to match my usage scenario. Perhaps it would be beneficial to show an example of the command's use with environment variables set for the npm process rather than for a single script entry:
|
Agreed. Thanks @derekgreer. Could you file a PR to update the README? |
Sure. |
I'm having a similar issue trying to use command substitution. It works in linux, but not windows. {
"scripts": {
"start": "cross-env-shell COMMIT_HASH=$(git show --no-patch --format=%h) react-scripts start",
}
} It fails with "react-scripts was unexpected at this time" using both cross-env-shell and cross-env. Am I doing something wrong here? Edit: I figured it out: #192 (comment) |
I'm running bash on windows. After upgrading from cross-env 4.0.0 to 5.0.0, environment variables don't seem to be replaced the same way.
This works:
This does not work:
The text was updated successfully, but these errors were encountered: