Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ENVFILE' is not recognized as an internal or external command, operable program or batch file. #122

Closed
jtuttle87 opened this issue May 26, 2017 · 5 comments

Comments

@jtuttle87
Copy link

After installing and linking the library, and adding the apply to the build.gradle, i'm trying to run 'ENVFILE=.env.dev react-native run-android' and getting that error. Anyone else seen this??

@ofirgeller
Copy link
Contributor

ENVFILE=.env.dev

This is a command that creates/sets the variable ENVFILE to the value .env.dev before running the react build.

It does not work on Windows.

You can try the windows command set and setx to set environment variables I did not have much success doing that and having react-native-config take that value into account.

I'm reading this lib source code now to try to see why the system variable is not being used, If someone has insight feel free to help.

@ofirgeller
Copy link
Contributor

If you are using powershell:
$env:ENVFILE="name.of.file"; react-native run-android

If you are using regular cmd:
SET ENVFILE = 'name.of.file' && react-native run-android

Good Luck!

@pedro
Copy link
Contributor

pedro commented Dec 5, 2017

👍! @ofirgeller nailed it, thank you!

This should be clearer in the latest readme.

@pedro pedro closed this as completed Dec 5, 2017
@leotm
Copy link

leotm commented May 2, 2019

For anyone using Git Bash:

set ENVFILE='name.of.file' && react-native run-android

@bsor-dev
Copy link

bsor-dev commented Nov 14, 2022

How to use this without using SET on windows? Somewhere can I put the ENVFILE on environmental variables and point to something

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

No branches or pull requests

5 participants