dotenv Questions

8

Solved

I'm trying to make a discord bot, and when I try to load a .env with load_dotenv() it doesn't work because it says Traceback (most recent call last): File "/home/fanjin/Documents/Python Proje...
Filide asked 8/11, 2020 at 1:49

9

I am trying to migrate my tests from jest to vitest. I have a test suite that uses the dotenv package to pull in my .env variables. I have this in my test suite beforeAll(async () => { vi.clear...
Sammysamoan asked 9/7, 2022 at 19:46

2

Solved

I'm trying to set configuration variables on my project using the official documentation. I added the following line to my app.module.ts imports: ConfigModule.forRoot({ isGlobal: true }), I cr...
Malonylurea asked 26/4, 2020 at 9:45

7

I have a file which connects to Contentful using my specific space and accessToken. Recently, I decided to hide the keys into an .env file using the dotenv package. This is what my file looks like ...
Littleton asked 2/1, 2021 at 3:46

8

Solved

I want to work with environment variables. Unfortunately, I am an inexperienced developer and decided very late to implement such a solution in my project. I'm trying to inject environment variabl...
Oppugn asked 3/11, 2019 at 21:7

1

I'm building an Electron app using Electron Forge and I need to pass environment variables to the final executable. I've tried defining the environment variables in forge.config.js like this: env: ...
Deliladelilah asked 4/5, 2023 at 21:10

5

I've tried a few implementations which none have been successful. First Attempt Using eval in package.json script "fetch:data": "eval $(cat .env) ts-node -O '{\"module\":\&...

6

Solved

I do have a .env file in my react project and using dotenv package to read the environment variables. I did a console log of the environment variables. I had initialized few variables in the beginn...
Retaliate asked 17/9, 2021 at 5:30

9

I'm trying to use dotenv with an angle, but when it comes to requiring dotenv require('dotenv').config() or const Dotenv = require('dotenv-webpack'); I get the following error: ERROR in ...
Deadwood asked 25/1, 2020 at 17:29

17

I'm trying to find the most legal way to set up NestJS database using .env file. That is I want to use @nestjs/config package for importing .env variables and use them in the TypeOrmModule. It seem...
Uranology asked 31/8, 2020 at 21:8

29

Solved

I have .env file at root folder file NODE_ENV=development NODE_HOST=localhost NODE_PORT=4000 NODE_HTTPS=false DB_HOST=localhost DB_USERNAME=user DB_PASSWORD=user And server.js file in the root/...
Parable asked 20/2, 2017 at 1:15

3

I have three .env files for local, dev and prod environment and I have to load specific environments file while doing deployment for that server i.e If am doing DEV deployment then dev .env file sh...
Airlift asked 23/11, 2020 at 12:46

10

Solved

I am working on my first NestJS application, which was working fine with hardcoded database connecting string in app.module.ts. But then as per our requirements, I had to pick the database config v...
Kibitz asked 6/8, 2020 at 13:50

13

Solved

I have an .env file at the root of my NestJs project with some env variables in it. The strange thing is that I am able to read the variables in service files but not in module files. So in a s...
Sicard asked 14/4, 2019 at 8:35

11

Solved

I want to use separate .env files for each mode (development, production, etc...). When working on my vue.js projects, I can use files like .env.development or .env.production to get different valu...
Toothy asked 28/3, 2019 at 20:8

14

I create this .env file: TYPE=xxx HOST=xxx, PORT=xxx, USERNAME=xxx, PASSWORD=xxx, DATABASE=xxx, in my file I use in this way: import * as dotenv from "dotenv"; dotenv.config(); export const t...
Venterea asked 9/6, 2020 at 16:46

7

Solved

I am moving an Express app across from CommonJS require syntax to the ES6 module import syntax. This is fine until I try and use dotenv to load my environment variables and every time I try to acce...
Brnaba asked 31/10, 2020 at 10:46

4

Solved

This might look like a newbie question, but I am unable to find the way to load environment variables from both .env and .env.local files in node with dotenv. Is it even possible? How do people loa...
Gumbotil asked 10/8, 2021 at 17:33

7

Solved

While loading the .env file to pass env values to the getToken.js script in the cypress root folder throws Cannot find module 'dotenv'error. I have installed npm install dotenv. Could someone pleas...
Clef asked 24/4, 2020 at 11:32

6

Solved

I'm trying to build a node.js server with express framework, and I want to store a private key for admin APIs in my server.I'm now using .env file to store those values, and in my routes, using tha...
Stoddard asked 23/2, 2020 at 8:9

4

Solved

What I am trying to do? I am trying to access my environment variable from the .env file and print its value in the terminal. What is the issue? When I run the script in the terminal I keep getting...
Tallou asked 8/6, 2022 at 19:12

2

Solved

I want to load environment variables into the general config of my Express app. Locally I work with a .env file, but when deploying, I'll inject the env vars into the docker container. So, I've go...
Popper asked 18/11, 2019 at 9:30

6

Solved

I'm trying to get access to my .env file via dotenv module, but I'm getting the below error dotenv.config(); ^ TypeError: Cannot read property 'config' of undefined I have dotenv installed in nod...
Deirdredeism asked 12/1, 2021 at 6:39

5

I am running a python script from a python library which loads some environment variables from a .env file in the root of the library using dotenv. This works from the command line, but when I try ...
Modal asked 2/7, 2020 at 17:41

2

I never thought I'd be using Stack Overflow, but here I am! I am unable to install DotEnv on Windows, when I execute pip install dotenv with its optional flags, this error is thrown: Collecting dot...
Outmost asked 5/8, 2020 at 16:10

© 2022 - 2025 — McMap. All rights reserved.