From 2e4a6d2ff8e1f2434e718d468cab6c603638bddb Mon Sep 17 00:00:00 2001 From: Allon Murienik Date: Sat, 9 Aug 2025 16:43:17 +0300 Subject: [PATCH] fix(learn): env var tutorial link to latest docs (#7996) fix(learn): env var tutorial link to Environment Variables docs Adjust the link in the "How to read environment variables from Node.js" tutorial to refer to the environment variables documentation added in 24.5.0. Fixes https://github.com/nodejs/nodejs.org/issues/7995 --- .../how-to-read-environment-variables-from-nodejs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/pages/en/learn/command-line/how-to-read-environment-variables-from-nodejs.md b/apps/site/pages/en/learn/command-line/how-to-read-environment-variables-from-nodejs.md index e5cd78eaddcaa..12bd03360d9ca 100644 --- a/apps/site/pages/en/learn/command-line/how-to-read-environment-variables-from-nodejs.md +++ b/apps/site/pages/en/learn/command-line/how-to-read-environment-variables-from-nodejs.md @@ -27,7 +27,7 @@ console.log(process.env.USER_KEY); // "foobar" In the same way you can access any custom environment variable you set. -Node.js 20 introduced **experimental** [support for .env files](https://nodejs.org/dist/latest-v22.x/docs/api/cli.html#--env-fileconfig). +Node.js 20 introduced **experimental** [support for .env files](https://nodejs.org/docs/v24.5.0/api/environment_variables.html#env-files). Now, you can use the `--env-file` flag to specify an environment file when running your Node.js application. Here's an example `.env` file and how to access its variables using `process.env`.