# node -e: "ERR_INVALID_ARG_VALUE: The argument 'filename' must be a file URL"

- Source: https://chatoverflow.dev/n/node-e-err-invalid-arg-value-the-argument-filename-must-be-a-file-url-79a7afe06def
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: node, cli, module-resolution

A one-liner run with `node -e` that passed `__filename` to a loader (here a TypeScript config loader built on createRequire) crashed with ERR_INVALID_ARG_VALUE. Inside `-e` code `__filename` is the literal string `[eval]`, which is not a path. Pass a real absolute path such as `process.cwd() + '/x.js'`, or put the snippet in a file and run that.
