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, &params->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

  1. Check the exact argument against the list of supported keys: comment, dictionary, lgwin, large_window, output, quality, suffix.
  2. Run `brotli --help` or `-h` to see the flags supported by this build.
  3. 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

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


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/63a45cac84698ed2. Report an issue: GitHub.