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

Accessing variable with $ does not work on windows with cross-env-shell #210

Closed
raDiesle opened this issue Sep 17, 2019 · 2 comments
Closed

Comments

@raDiesle
Copy link

raDiesle commented Sep 17, 2019

  • cross-env version: 5.2.1
  • node version: 10.16.0
  • npm version: 6.9.0

On Windows 10, the example from documentation does not print variable by using $GREET, but %GREET% works:

{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"parentScript": "cross-env GREET="Joe" npm run childScript",
"childScript": "cross-env-shell "echo Hello $GREET""
},
"author": "",
"license": "ISC",
"dependencies": {
"cross-env": "5.2.1"
}
}

By performing

npm run parentScript

In .npmrc PowerShell is configured

@raDiesle
Copy link
Author

I figured out by switching PowerShell back to default CMD, it works!

I guess documentation should be updated or to support PowerShell.

@kentcdodds
Copy link
Owner

Sorry for not responding to this earlier. It's been long enough that I'm going to close this issue. If you're still experiencing problems, please open a new issue.

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