.env is deprecated in Replit

Regarding this section: https://www.freecodecamp.org/learn/back-end-development-and-apis/basic-node-and-express/use-the--env-file

We are no longer able to add .env files, we need to use their environment variables section in the sidebar, which is then used in the code as such: const { MESSAGE_STYLE } = process.env (they do NOT use dotenv which is required for this section/test)

From the page you linked:

Note: If you are using Replit, you cannot create a .env file. Instead, use the built-in SECRETS tab to add the variable.

Also, the paragraph that mentions the dotenv package starts with “If you are working locally”.

1 Like

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