.env Not Syncing

Hello, I have this project here
https://glitch.com/edit/#!/ojvjpj?path=index.js%3A15%3A17
that runs
process.env.variable = "hi";
console.log(process.env.variable);
It logs hi just fine, but when I go to the .env file, I see this


I have tried the refresh command and reloading, but nothing happens.

there’s some nuance to how you’re able to “access” the values set in the .env file. processes have an “environment” that’s a collection of named values. glitch initializes your program by reading the .env file and setting up named values in its environment based on what it reads. the process.env object lets you read and write the process’s environment, but it doesn’t go out and write it to the .env file.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.