[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"howto:env:windows:en":3},{"resolvedFromAlias":4,"canonicalExt":5,"ext":5,"name":6,"category":7,"categoryName":8,"updatedAt":9,"os":10,"osLabel":11,"quickSolution":12,"stepByStep":13,"recommendedSoftware":16,"alternativeMethods":17,"commonIssues":18,"securityNote":37,"extensionPath":38,"extensionLabel":39,"breadcrumbs":40,"metaDescription":50},false,"env","Dotenv environment variables file","config","Configuration","2026-06-12T08:04:24.304Z","windows","Windows","To open .ENV files on Windows, right-click the .env file and choose Open with, then pick a text editor (for example, Notepad).",[14,15],"Right-click the .env file and choose Open with, then pick a text editor (for example, Notepad).","If you’re using Node.js to consume it, run: node --env-file=.env your-script.js (from a terminal in the project folder).",[],[],[19,25,31],{"title":20,"description":21,"steps":22},"Variables don’t load because the app never reads the .env file","A .env file is not automatically applied by the operating system. It must be explicitly loaded by the runtime/tool (for example, Node.js CLI --env-file or a dotenv library).",[23,24],"For Node.js, use the documented CLI option: node --env-file=.env your-script.js.","If your project uses a dotenv library, ensure it is actually invoked early in startup (for example, before accessing environment variables).",{"title":26,"description":27,"steps":28},"Parsing errors due to formatting differences (quotes, spaces, comments)","There is no formal dotenv spec; different implementations can interpret quoting, whitespace, and comments differently. A line that works in one tool may be ignored or parsed unexpectedly in another.",[29,30],"Use simple KEY=VALUE lines and avoid extra spaces around '=' unless your loader explicitly supports them.","If a value contains special characters, follow the parsing rules of the tool you are using (check Node.js .env parsing behavior or your dotenv library’s documentation).",{"title":32,"description":33,"steps":34},"Secrets accidentally committed to Git or shared",".env files often contain API keys, tokens, or passwords. If the file is committed to a repository or uploaded, those secrets may be exposed.",[35,36],"Do not commit real secrets; keep .env out of version control and share a non-secret example file separately.","Rotate/revoke any credentials that were accidentally exposed and update the affected services.",".env files commonly contain secrets (API keys, tokens, passwords). Treat them like credentials: restrict access and avoid committing them to source control.","/file-extension/env",".ENV",[41,44,47],{"label":42,"to":43},"Home","/",{"label":45,"to":46},"How To","/file-extension",{"label":48,"to":49},"Open .ENV on Windows","/how-to/open-env-on-windows","Learn how to open .ENV files on Windows with step-by-step instructions, recommended software, and troubleshooting tips."]