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

How to run cross-env from powershell in Windows? #242

Closed
GorvGoyl opened this issue May 21, 2020 · 1 comment
Closed

How to run cross-env from powershell in Windows? #242

GorvGoyl opened this issue May 21, 2020 · 1 comment

Comments

@GorvGoyl
Copy link

  • cross-env version: 7.0.2
  • node version: 10
  • npm (or yarn) version: 6.13.4
  • powershell: 6.2.3
  • platform: windows
  • IDE: 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

@GorvGoyl
Copy link
Author

I had to install it globally.

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

1 participant