React-native-config: "Missing .env file" building android on windows OS

Created on 9 Jan 2018  路  10Comments  路  Source: luggit/react-native-config

Environment:
OS: Windows 10
Node: 6.10.0
Yarn: 0.21.3
npm: 3.10.10
Watchman: Not Found
Xcode: N/A
Android Studio: Version 2.3.0.0 AI-162.3764568

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.4 => 0.48.4

Version: [email protected]

Steps to Reproduce

  1. Run set ENVFILE='.env.local' && react-native run-android
  2. After the first few lines, console shows the following logs:
Reading env from: '.env.local'
**************************
*** Missing .env file ****
**************************
  1. Unable to get the config variable values

Most helpful comment

Solution: For windows users, running command without quote when setting ENVFILE variable works

set ENVFILE=.env.dev && react-native run-android

All 10 comments

Solution: For windows users, running command without quote when setting ENVFILE variable works

set ENVFILE=.env.dev && react-native run-android

Hello Can anyone explain how to resolve this below issue on react-native app

Scanning folders for symlinks in C:Userssrcmobile-appnode_modules (48ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Reading env from: env.prod

* Missing .env file **

@policz Did you got any solution for dis problem?

No, Yet i didn't any solution.

@policz Me too same here.
Only workaround now found is to create a new env file(with extension .env) and use it for the builds.

Is env.prod in the same dir? How are you making it pick that diff env?

Closing the original issue now that #222 is in/let me know of any updates here.

@pedro
Yes. Both config files are in the same dir.

As mentioned here I am using either ENVFILE=.env.uat or ENVFILE=.env.stg depending on env I need. It was working earlier. But only from few days it's not working.

I'm getting that error message having the .env files in different path to root dir.

Path received is right: Documents/GitHub/user-mobile/src/whiteLabel/canarias/.env.demo

Other possible path used is: Documents/GitHub/user-mobile/src/whiteLabel/mallorca/.env.demo

Do someone know anything?

Please note that for .sh files to set environment variable you should do:
export ENVFILE=.env.prod

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jtuttle87 picture jtuttle87  路  4Comments

timscott picture timscott  路  5Comments

swl367 picture swl367  路  4Comments

arcollector picture arcollector  路  4Comments

himanshu-satija picture himanshu-satija  路  3Comments