How to run cross-env from powershell in Windows?
GorvGoyl opened this issue · comments
Gourav Goyal commented
cross-env
version: 7.0.2node
version: 10npm
(oryarn
) version: 6.13.4powershell
: 6.2.3platform
: windowsIDE
: VSCode
Relevant code or config
What you did:
I have installed cross-env in my project npm install --save-dev cross-env
but how to set environment variable from powershell? when I execute cross-env NODE_ENV=dev
in powershell it shows below error
What happened:
cross-env : The term 'cross-env' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ cross-env NODE_ENV=production
+ ~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (cross-env:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Reproduction repository:
Problem description:
Suggested solution:
It should set env variable similar to how package.json does when we use cross-env NODE_ENV=developement
Gourav Goyal commented
I had to install it globally.