Questions tagged [environment-variables]
Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.
12,306
questions
0
votes
1
answer
8
views
Pass ENV variables specified in shell from docker-compose to Dockerfile
I would like to set the DEPLOY_ENV environment variable when I build my Docker image, but the value doesn't seem to be making it to the Dockerfile. Here's my build command:
docker-compose.yml
version: ...
1
vote
0
answers
5
views
Bitbucket pipelines with different build variables
I have a simple Vue.js project that utilizes Vite to build the distribution. I am utilizing dotenv to target specific environments for my deployment via different .env files such as .env and .env.dev ...
0
votes
0
answers
25
views
Why does os.environ['my_variable'] work but os.environ.get('my_variable') doesn't? [closed]
While playing with os.environ instance I found a funny issue. After exporting environmental variable my_variable I get None when calling os.environ.get('my_variable') but I get this variable's value ...
0
votes
1
answer
24
views
/etc/profile missing end to balance this if statement
When I wanted to configure environment variables for JAVA on Linux. I added some sentences to the file, /etc/profile.
Now the content in it is as follow.
# /etc/profile: system-wide .profile file for ...
0
votes
0
answers
13
views
Config.get() fetching default.json value for the environment variable after setting the variable value in powershell
In index.js I want to get the value of an environment variable. But I am not able to read custom-environment-variable.json file, instead I am getting the value of the variable from default.json
index....
0
votes
0
answers
16
views
How to set environment variable in Postman depending on other values in response?
Using GET request, I have the following response:
[
{
"id": "ID_1",
"name": "",
"color": "orange&...
0
votes
0
answers
14
views
Caused by: java.net.SocketTimeoutException: Accept timed out
I am getting this error while running pyspark package in pycharm using python 3.9 using this below code.
from pyspark.sql import SparkSession
from pyspark.sql.types import *
from pyspark.sql.functions ...
0
votes
0
answers
17
views
.env file shows errors(red underlines) in vscode - it works fine though
I'm having this project structure:
Although the file works correctly but it shows errors(red underlines) in VSCODE.
Why does this happen and how can we solve this?
0
votes
1
answer
24
views
How do I read a .env file from a .ps1 script?
I have a .env file like this one:
TESTCASE_GROUP_SIZE=25
. . .
And I want to get its value (read it) into a .ps1 script.
How can I do it?
0
votes
1
answer
28
views
Provide run time environment variable path (e.g. LD_LIBRARY_PATH) to third party dependency in bazel
In the code base I am working with we use the oracle instant client library as a third party dependency in Bazel as follows:
cc_library(
name = "instant_client_basiclite",
srcs = ...
0
votes
3
answers
24
views
Executing multiple commands with ssh, including evaluation of environment variables on the remote machine
I sometimes use ssh to run multiple commands on a remote host like this:
ssh my_user@my_host "command1; command2"
utilizing double quotes to send both commands to the remote machine.
Now I ...
-1
votes
0
answers
28
views
Why are the contents of PS1 in my program null? [duplicate]
I try to get the content of the variable PS1 but i get null
#include <stdio.h>
#include <stdlib.h>
int main(){
printf("%s", getenv("PS1"));
}
When I compile and run ...
0
votes
1
answer
22
views
In powershell, how can I define all env vars for the next command similar to python's Popen abilities?
In powershell, how can I...
explicitly define all the env vars for the next command?
I don't want any system env vars if possible,
After this command runs I dont want anything we have done to affect ...
0
votes
0
answers
10
views
Adding run/debug configuration environment variables to a flutter project?
I am trying to add Environment Variables to my Run/Debug Configurations in my flutter project in Android Studio but the field is greyed out and I have no idea how to otherwise create environment ...
0
votes
1
answer
21
views
Updating Path multiple times in the same RUN command
Consider the following Dockerfile. On the last lines, first git is installed, and then something is appended to the path environment variable.
FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ...
0
votes
0
answers
12
views
How i can set & save my custom env. variable in Heroku?
I try to set value of my custom env. variable in my C# Telegram bot via this class:
namespace rock_paper_scissors_game_bot
{
public static class EnviromentManager
{
public const string ...
0
votes
1
answer
21
views
How to read environment variables in env section of github action workflow
I'm trying to set a env variable based on another env variable in a github workflow. I've tried a couple of syntax options but none seem to work
on:
push:
branches: [ master ]
pull_request:
...
0
votes
0
answers
14
views
process.env is undefiened not able to use env variables?
i just cant use .env i tried adding dotenv but i found that the process.env is undefiened
server.js
const express=require('express')
const app=express()
require('dotenv').config({path:__dirname+'/./...
0
votes
0
answers
40
views
How to correctly deploy Next Js applications in kubernetes cluster with environments variables
I need my Next js application to read the .env file when deployed to kubernetes.
What I do for this:
As we know, in order for the next js application to read the .env file, this file must already be ...
-1
votes
0
answers
48
views
+50
environmental variable not being read (NPM)
So I have a project running with nodejs, and an env file using multiple variables. For some reason one of these does not seem to be working though.
Here the code should be printing out the port and ...
0
votes
0
answers
12
views
Access GitHub Secrets in local env file
Is there a way to access GitHub secrets in a local env file? So instead of having a secret saved directly in the env file it would reference a GitHub secret. I've seen that the GitHub secrets can be ...
0
votes
1
answer
28
views
Getting undefined value of .env in nodejs
I am getting "undefned value of .env in nodejs. my .env file is on root directory.need help
my code for .env file:-
SECRET_KEY=mynameissuky
my app.js file:-
require('dotenv').config();
console....
1
vote
2
answers
47
views
Environment variables in Nuxt 3 with Pinia
I'm trying to render env variable in Pinia store within defineStore() using useRuntimeConfig(), but the store can't use the method, throwing error:
"Nuxt instance is not unavailable".
I came ...
0
votes
0
answers
19
views
How to replace file with envsubst? [duplicate]
I run nano test.txt
Hello $NAME
then export NAME="World"
Then I run envsubst < text.txt it prints Hello World
Then I run envsubst < text.txt > new.txt it saves Hello World into ...
0
votes
1
answer
22
views
How to set env variable in Heroku with Node.js? how to do that? [closed]
I am trying to set an environment variable for socks proxy. This variable is dependent on ip and port. i.e. socks://23.244.534.344:8080 Issue is that in Heroku the port is dynamic. Unfortunately I ...
1
vote
2
answers
32
views
Gatsby project not developing because of connection error with Contentful
I opened an old Gatsby project on a new computer to try and complete, but when I tried to set up my development I ran into this issue:
ERROR
Problems with gatsby-source-contentful plugin options:
...
0
votes
0
answers
9
views
Using Terraform and creating lambda module, how to set default env variables and add custom ones if required
I'm trying to create a custom Terraform AWS lambda module that will have a set of default environment variables in all lambdas, while allowing the option through a variable to add custom env variables ...
0
votes
0
answers
29
views
.env file vs constants stored in a file. What is the difference?
I have been using .env files for some time. I want to know if there are any advantages of using .env file (dotenv-javascript) over storing and using constants a normal .js file?
Thanks :)
1
vote
0
answers
18
views
Angular Dynamic styleUrls with environment variable are not loaded by StorybookJS
Currently I'm working on a project where we are building our application in multiple styles. Our components have one base component.scss file and multiple stylesheets for the project-specific styling. ...
-1
votes
0
answers
16
views
How to do works mongodb crud?
How to write express js and insert operations code on the server-side? Please explain it!
import { MongoClient } from "mongodb";
// Replace the Uri string with your MongoDB deployment's ...
0
votes
1
answer
30
views
Setting environment variables in qmake
With the following dummy qmake syntax I am trying to set an environment variable and then check it later:
MY_VAR = true
message("A")
defined(MY_VAR){
message("B")
}
The ...
0
votes
0
answers
19
views
set environment variable from inside visual studio code
I like to start Visual Studio Code by opening a particular project with the GIT_DIR environment variables set:
GIT_DIR=~/.local/share/yadm/repo.git code ~/.config/yadm
This works, and the git ...
-1
votes
0
answers
38
views
Where can I find environment variables in MacOS Monterey?
I do a lot of search on finding environment variables. When I use the command printenv. I see a lot of environment variables. But I can't find them in my MacOS system.
I tried to open ~/.bash_profile ...
0
votes
1
answer
20
views
Where should i place environment file in a react based client side application?
In my react application ,i have placed environment file named ".env.local" in src folder.And i have moved the firebaseConfig object to environment file.But i am getting an error which is ...
-1
votes
0
answers
19
views
firebase connection error in env react js project
When i try to connecting firebase i put the access key to the .env file and access the data by process.env.REACT_APP_apiKey i'm getting error.but if directly put the data its connecting .how can i ...
0
votes
0
answers
7
views
After adding env file to my project the firebase auth is not working, console showing the api key is not correct
Here how I connected firebase with environment variable:
const firebaseConfig = {
apiKey: process.env.REACT_APP_apiKey,
authDomain: process.env.REACT_APP_authDomain,
projectId: process.env....
0
votes
1
answer
27
views
environment variable undefined in react js
I am trying to get the environment variable from .env file, I have followed all steps
but don't know why it's showing an undefined value
.env file
REACT_APP_NAME=user
in React
console.log(process.env....
-1
votes
1
answer
49
views
Appending values to existing values of environment variables in go
How can I append another value to an existing value of a go environment variable?
If CGO_CXXFLAGS has the value "-I/blah/blah"
Since the following doesn't work
$ go env -w CGO_CXXFLAGS="...
0
votes
1
answer
35
views
Subprocess $Env:Path python: The filename, directory name, or volume label syntax is incorrect
I am trying to change the windows environment variables, but I am having trouble doing so.
Before I tried to use os.environ() I tried out using powershell commands and adding a string to $Env:Path ...
0
votes
1
answer
16
views
echoing PROMPT_COMMAND from terminal and from bash script
while trying to write a bash script i encountered a strange issue when i try to execute it.
i want to echo the $PROMPT_COMMAND variable thus, i have the following piece of bash script
#!/bin/bash
...
0
votes
0
answers
19
views
How to connect firebase through use environment variable? [closed]
Firebase init page
Environment variable local page
Environment error
0
votes
1
answer
16
views
How do I provide environmental variable with my custom Cloud Foundry buildpack?
I have extra simple custom sidecar buildpack. All it does in /bin/supply is downloading and untarring to $DEPS_DIR/$DEPS_IDX/mylibrary certain dependency library. Since I can have more than one ...
1
vote
1
answer
31
views
What is wrong with my crypto price discovery bot?
I'm following Dapp Universitie's Create a PROFITABLE cryptocurrency trading bot video.
I use git and npm install but when I run npm run start in the terminal I get the following:
node index.js
...
1
vote
1
answer
62
views
Mvn is not recognized as a command on Github Actions on Windows a self hosted runner
I set up a simple Github Actions workflow simply to check if my self-hosted Windows Virtual Machine is able to recognize the installed java/git/maven versions.
Versions in the Virtual Machine:
...
-1
votes
0
answers
25
views
Set environmental variables from shell script in Jenkins pipeline
I have a requirement where I have a shell file (init.sh) which sets environmental variables based on conditions.
My pipeline looks something like this
pipeline {
agent {
kubernetes {
...
0
votes
0
answers
28
views
Can not Access variables of .env file
In my React app, I was trying to access some variables from .env.local but every time I print It it shows undefined.
// src/.env.local
REACT_APP_SECRET_CODE=123456
// In different component
console....
0
votes
2
answers
48
views
What's the proper way to fix this type error?
What's the proper way to fix this? I don't want to just cast or make a copy of the array, converting undefined to an empty string or something like this. I guess it's hacky. What's the proper way to ...
0
votes
0
answers
6
views
Couldn't solve firebase .env with react
I can not connect with localhost when I put my code in .env file in React app. It shows some warnings and the page will blank. But without the .env for firebaseconfig object everything is good. Here ...
0
votes
0
answers
22
views
Multiple Python Version Env Setup
I'm working in the VFX industry and we deal with different software packages that ship with their own Python interpreter. We are running on Linux and use modules to handle our environments to make ...
1
vote
1
answer
47
views
Can I set and get flags on Linux using my Rust application?
I am building a rust application, when the application is running, I want to set an OS level flag (an ENV variable) saying.. MY_CUSTOM_APP_RUNNING=true and set it to false when application stops!
Also,...