You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.
{
"scripts": {
"worksOnWin": "cross-env AUTHORIZER={\\\"claims\\\":{\\\"permissions\\\":\\\"\"[view:accounts manage:accounts]\"\\\",\\\"sub\\\":\\\"auth0|5cfe0adce3c4c50ea072ea9f\\\"}} AWS_PROFILE=elit_nonprd npm run env",
"worksOnNix": "cross-env AUTHORIZER=\"{\\\"claims\\\":{\\\"permissions\\\":\\\"[view:accounts manage:accounts]\\\",\\\"sub\\\":\\\"auth0|5cfe0adce3c4c50ea072ea9f\\\"}}\" AWS_PROFILE=elit_nonprd npm run env",
}
What you did: I tried to create a single npm script that would set an environment variable called AUTHORIZER (needed when running an AWS Serverless app in offline mode) that took a value containing a space (here an array of permissions). The intended result is that the environment variable AUTHORIZER takes the following value:
The best I could manage (with help from the Stack Overflow community) was the two platform-specific scripts above.
What happened: I failed to write a single script for both Windows and *Nix platforms and instead had to ditch cross-env altogether and resort to writing custom JavaScript code. See this issue on Stack Overflow. Trying to run the *Nix script on Windows gives the error The system cannot find the path specified..
Reproduction repository:
None.
Problem description:
There appears to be a bug in cross-env when setting environment variables that take values containing spaces.
Suggested solution:
None.
The text was updated successfully, but these errors were encountered:
cross-env
version: 7.0.2node
version: 12.16.1npm
(oryarn
) version: 6.13.4Relevant code or config:
What you did: I tried to create a single
npm
script that would set an environment variable calledAUTHORIZER
(needed when running an AWS Serverless app in offline mode) that took a value containing a space (here an array of permissions). The intended result is that the environment variableAUTHORIZER
takes the following value:The best I could manage (with help from the Stack Overflow community) was the two platform-specific scripts above.
What happened: I failed to write a single script for both Windows and *Nix platforms and instead had to ditch
cross-env
altogether and resort to writing custom JavaScript code. See this issue on Stack Overflow. Trying to run the *Nix script on Windows gives the errorThe system cannot find the path specified.
.Reproduction repository:
None.
Problem description:
There appears to be a bug in
cross-env
when setting environment variables that take values containing spaces.Suggested solution:
None.
The text was updated successfully, but these errors were encountered: