Questions tagged [env-cmd]
12 questions
12
votes
2 answers
how to use .env.qa or .env.staging with create react app
The CreateReactApp documentation shows that you can use a limited number of .env files.
https://create-react-app.dev/docs/adding-custom-environment-variables/#adding-development-environment-variables-in-env
I want to use more .env files for other…

cyrf
- 5,127
- 6
- 25
- 42
3
votes
1 answer
Override .env with inline arguments
Is it possible to override the variables inside .env on run or build?
Content of the .env file
REACT_APP_REGIONALIZED_BASE_API_URL=http://hello-default.net
Command script in package.json
"scripts": {
"start:production": "env-cmd -f .env…

duduwe
- 888
- 7
- 16
2
votes
1 answer
Dollar sign not allowed in env-cmd
I would like to ask if what's wrong with the dollar sign within the environment variable? I tried to do everything to fix the problem I've encountered using env-cmd package from npm with…

Antolin Bernas
- 182
- 3
- 9
2
votes
1 answer
Install env-cmd on github
I'm manually setting up the environment variable depending what build I'am using ( QA or PROD ) and I'm using github actions to deploy my qa build..
So change the script from npm run build to env-cmd -f ./.env.qa node scripts/build.js.
The problem…

Hiimdjango
- 431
- 5
- 21
1
vote
2 answers
Setting up React environment variables for dev and local
I am new to react and setting up environment variables for my project. Here is what I did..
added .env-cmdrc.json as follows
{
"development":{
"REACT_APP_BASE_URL": "https://servername:port/"
},
"staging":{
"REACT_APP_BASE_URL":…

Samra
- 1,815
- 4
- 35
- 71
0
votes
0 answers
env-cmd command is not fetching environment variables in Nextjs
I am trying to use env-cmd to load environment variables in next js
"scripts": {
"dev": "env-cmd -f .env.build next dev -p 3006",
"build": "env-cmd -f .env.build next build",
"start": "next start -p 3006",
"lint": "next lint",
}
However, it is…

africandrogba
- 334
- 1
- 3
- 21
0
votes
1 answer
Cypress Github Actions load env file like env-cmd
What is the equivalent configuration for Github Action similar function like the command below:
env-cmd -f .env cypress run --component
I tried with one env var imported into Github Action, but not working:
env:
CYPRESS_PUBLIC_PATH: /public/
So,…

Darryl RN
- 7,432
- 4
- 26
- 46
0
votes
0 answers
env-cmd throwing error even with -f applied
I'm have env-cmd installed locally on a windows 10 setup. Calling env-cmd -f .env.local returns the error:
Error: Failed to find .env file at default paths: [./.env,./.env.js,./.env.json]
I even installed the library in to my app and run it from the…

dcp3450
- 10,959
- 23
- 58
- 110
0
votes
1 answer
env-cmd Failed to find .rc file at default paths
I am using the tool env-cmd to manage my environment variables, and am encountering the error:
Error: Failed to find .rc file at default paths: [./.env-cmdrc,./.env-cmdrc.js,./.env-cmdrc.json]
I have verified that the file (in my case…

Brian Thompson
- 13,263
- 4
- 23
- 43
0
votes
0 answers
Failed to find .env file at default paths:[./env,./.env.js,./.env.json]
my package.json file code is:
"start:development": "env-cmd -f .env.development node scripts/start.js",
"build:development": "env-cmd -f .env.development node scripts/build.js
0
votes
1 answer
Using env-cmd to pass bash env variables into new shell
I'm attempting to build a environment variable: PUBLIC_URL for a react app out of two pre-existing ENV vars DOMAIN and URL_PREFIX. I'm hoping to do so right before running the 'react-scripts build' command within an npm script.
I'm using a…

Nate W
- 25
- 1
- 6
-1
votes
2 answers
facing issue to start react application npm start error
when I issue below command to start react app facing this error, can anyone help.
npm start
react_template@0.1.0 start
env-cmd -f .env.dev craco start
'env-cmd' is not recognized as an internal or external command,
operable program or batch file.

Mallikarjun D
- 1
- 1