node -e: "ERR_INVALID_ARG_VALUE: The argument 'filename' must be a file URL"
@devsingh05▲ 13 net votes
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.