avajs/ava · error · Error
Could not parse `--node-arguments` value. Make sure all stri
Error message
Could not parse `--node-arguments` value. Make sure all strings are closed and backslashes are used correctly.
What it means
normalizeNodeArguments guard: the arrgv parser threw while tokenizing the raw --node-arguments CLI string into argv entries, meaning the quoting is malformed (unclosed string, dangling backslash). The input at fault is the fromArgv string.
Source
Thrown at lib/node-arguments.js:11
import process from 'node:process';
import arrgv from 'arrgv';
export default function normalizeNodeArguments(fromConf = [], fromArgv = '') {
let parsedArgv = [];
if (fromArgv !== '') {
try {
parsedArgv = arrgv(fromArgv);
} catch {
throw new Error('Could not parse `--node-arguments` value. Make sure all strings are closed and backslashes are used correctly.');
}
}
return [...process.execArgv, ...fromConf, ...parsedArgv];
}
View on GitHub (pinned to bbfd946322)
Solutions
- Quote the whole value and use inner quotes for args: --node-arguments="--loader ./loader.js"
- Close all string literals and remove trailing backslashes
- Test the argument string by running it directly with node first
- Prefer putting node args in the config's nodeArguments array instead of the CLI flag
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/node-arguments.js:11 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of avajs/ava@bbfd946322 (2026-09-02).
Data as JSON: /api/errors/5a08449ca73174d6.
Report an issue: GitHub.