nodejs/node · error
invalid parameter: [%s]\n
Error message
invalid parameter: [%s]\n
What it means
The brotli CLI rejects a `--key=value` style parameter whose key does not match any recognized name. Valid keys are `comment`, `dictionary`, `lgwin`, `large_window`, `output`, `quality`, and `suffix`. The message echoes the full unparsed argument (e.g. `--foo=bar`) so the developer can see which token was not understood.
Source
Thrown at deps/brotli/c/tools/brotli.c:679
if (quality_set) {
fprintf(stderr, "quality already set\n");
return COMMAND_INVALID;
}
quality_set = ParseInt(value, BROTLI_MIN_QUALITY,
BROTLI_MAX_QUALITY, ¶ms->quality);
if (!quality_set) {
fprintf(stderr, "error parsing quality value [%s]\n", value);
return COMMAND_INVALID;
}
} else if (strncmp("suffix", arg, key_len) == 0) {
if (suffix_set) {
fprintf(stderr, "suffix already set\n");
return COMMAND_INVALID;
}
suffix_set = BROTLI_TRUE;
params->suffix = value;
} else {
fprintf(stderr, "invalid parameter: [%s]\n", arg);
return COMMAND_INVALID;
}
}
}
}
params->input_count = input_count;
params->longest_path_len = longest_path_len;
params->decompress = (command == COMMAND_DECOMPRESS);
params->test_integrity = (command == COMMAND_TEST_INTEGRITY);
if (input_count > 1 && output_set) return COMMAND_INVALID;
if (params->test_integrity) {
if (params->output_path) return COMMAND_INVALID;
if (params->write_to_stdout) return COMMAND_INVALID;
}
if (params->reject_uncompressible && params->write_to_stdout) {
return COMMAND_INVALID;View on GitHub (pinned to 1b2de5e052)
Solutions
- Check the exact argument against the list of supported keys: comment, dictionary, lgwin, large_window, output, quality, suffix.
- Run `brotli --help` or `-h` to see the flags supported by this build.
- Correct the spelling or remove the unsupported parameter from the command line or build script.
Example fix
// before brotli --quailty=5 input.txt // after brotli --quality=5 input.txt
Defensive patterns
Strategy: validation
Validate before calling
// Validate recognized parameter keys before invoking brotli
#include <string.h>
#include <stdbool.h>
static bool is_valid_brotli_param(const char *key) {
static const char *known[] = {
"comment", "dictionary", "lgwin",
"large_window", "output", "quality", "suffix", NULL
};
for (int i = 0; known[i]; i++) {
if (strcmp(key, known[i]) == 0) return true;
}
return false;
}
// Before building argv:
// extract key before '=' and call is_valid_brotli_param(key)
// reject / log / skip if false Prevention
- Validate parameter names against the brotli help output before scripting.
- Use a thin wrapper script that maps your config keys to the correct brotli flag names.
- Pin the brotli version in CI so the supported flag set does not change unexpectedly.
When it happens
Trigger: Passing `--unknownkey=value` or misspelling a valid key (e.g. `--quailty=5`, `--ouput=foo.br`). The parser reaches the final `else` branch at line 678 after every `strncmp` check against the seven known keys fails.
Common situations: Typos in scripting or Makefile targets; copying options from a different brotli version that supports a flag this build does not; using a flag from a wrapper library that maps to a different CLI name.
Related errors
- too many options passed
- quality already set
- write to standard output already set
- command already set when parsing -d
- force output overwrite already set\n
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/63a45cac84698ed2.
Report an issue: GitHub.