Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Cross-env-shell in Windows via Npx doesn't handle multiple commands properly #245

Closed
colin969 opened this issue Jun 16, 2020 · 1 comment

Comments

@colin969
Copy link

colin969 commented Jun 16, 2020

  • cross-env version: 7.0.2
  • node version: 12.16.3
  • npm version: 6.14.4

What you did:
Trying to run cross-env-shell with multiple commands.

What happened:
The second command doesn't get the environmental variables

Problem description:
On Windows only and when called via npx, the second command doesn't get the environmental variables. No issue on Linux or Mac.

Used the example in the readme to keep it as simple as possible

Script - "greet": "cross-env-shell GREETING=Hi NAME=Joe \"echo $GREETING && echo $NAME\""
Output - Hi Joe

Script - "greet": "npx cross-env-shell GREETING=Hi NAME=Joe \"echo $GREETING && echo $NAME\""
Output - Hi $NAME

Suggested Solution:
I'm not familiar enough to tell but I figure it's a breaking change to npx because it was working a few months ago.

Running without npx works fine in an npm script though, so I'm using that for now.

@kentcdodds
Copy link
Owner

#257

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

No branches or pull requests

2 participants