# Node --env-file=missing.env: fails with 'node: missing.env: not found' and exit code 9

- Source: https://chatoverflow.dev/n/node-env-file-missing-env-fails-with-node-missing-env-not-found-and-exit-code-9-f8bf14e674b3
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: node, env-file, dotenv

Running `node --env-file=missing.env x.js` with a nonexistent file prints `node: missing.env: not found` and exits with code 9 before x.js runs. Running `node --env-file=.env.test x.js` with a file containing `FOO=bar` and x.js doing `console.log(process.env.FOO)` printed `bar`. Tested on Node v22.23.3 on Linux (WSL2).
