All Questions
Tagged with environment-variables node.js
1,046 questions
0
votes
1
answer
26
views
Using fnm on Windows CMD: "failed printing to stdout: The pipe is being closed" Error
I'm trying to set up Node.js using fnm on my Windows machine (using the Command Prompt). I installed fnm via winget and then installed Node.js version 22 with the following commands:
winget install ...
1
vote
1
answer
76
views
Node.JS: how do I set an environment variable in 1 file to be read all others?
I have a bunch of files that run various tests and return results to a log file.
I have helper functions that create and log file and add to it.
I want to dynamically name that log file, based off the ...
0
votes
1
answer
165
views
Bad Option: --env-file=./env/.env.dev
I am unable to load the env file via start script in my package.json file because of which I am not able to work on my project, earlier with all these stated settings it used to work fine.
package....
-3
votes
1
answer
58
views
Error Handling Environment Variables Natively in Node.jsv22 Within a Container
I am trying to work with .env files natively, as starting from Node.jsv20 (I am currently using version v22.14.0), it is no longer necessary to install libraries like dotenv to manage environment ...
-1
votes
1
answer
176
views
C:\Program Files\nodejs\node.exe: --r= is not allowed in NODE_OPTIONS
I installed Node.js on a new laptop. I cloned my Next.js project from Github and ran npm install for installing node modules, which ran properly.
To run my local development server, I am running npm ...
0
votes
2
answers
112
views
How to change environment variables at runtime in a SvelteKit App using the Node adapter?
I have a SvelteKit app that I am using with the Node adapter to run as a Node.js server. I would like to change the environment variables at runtime so that I can package the app into a container and ...
0
votes
0
answers
35
views
Environment not loading correctly while running tests in Node.js with Jest
I'm having an issue with my Node.js project where the environment variables are not loading correctly during my tests.
Environment: Node.js , Typescript , Jest and supertest for testing, Express.js ...
0
votes
0
answers
13
views
How to determine machine environment when running a Webpack command with a given environment parameter?
I stumbled upon an issue while determining the actual environment of the Webpack project I'm working on.
When the project gets deployed to a testing or production environment, a different file path is ...
-1
votes
1
answer
31
views
Dotenv cannot use nodejs typescript
I had a problem with the env configuration and this my code.
I have consulted some solutions, but still can not solve the problem. Can you help me?
{
...
"type": "module",
&...
-1
votes
1
answer
111
views
How to add user's PATH to systemd service without hardcoding it?
I have a systemd service like so:
[Unit]
Description=description here
After=database.service
[Service]
Type=simple
User=user
WorkingDirectory=/home/user/project
ExecStart=/home/user/.local/share/pnpm/...
0
votes
1
answer
44
views
Node.js does not read env variable set in Mac native Terminal
I am running Node.js application from VS Code. I wanted to save my Database password in an env variable. I exported the data on my Mac native Terminal app and on echo, I was able to retrieve the data.
...
0
votes
0
answers
61
views
While using UseState the env variables are not accessible, is there an alternative of accessing those environment variables?
I am developing project using Sanity and Next.js, where I have a grid of products, and in this grid, while the product Cards are correctly mapped and displayed there is a button. while clicking on ...
0
votes
0
answers
92
views
NODE_ENV value of 'production' did not match when running env.production in node
I am running a typescript node project with default environment variables .env which is running well, as the command is
ts-node-dev --respawn --transpile-only --exit-child src/app.ts
then I built a ...
0
votes
2
answers
126
views
Environment Variables Not Accessible in Specific Files with Node.js and dotenv
I’m building a Node.js + Express.js server and using the dotenv package for environment variable management. While I can successfully access environment variables in most parts of my code, I’m ...
0
votes
0
answers
24
views
Programmatically detecting Application Mode in Plesk Node.js container
I have a React front-end that uses an Express back-end hosted in separate spaces on the same server. Both elements use Plesk's Node.js application containers. Both elements have a development and ...