stablyai/orca · error · Error

Unknown argument: ${arg}

Error message

Unknown argument: ${arg}

What it means

Thrown by the readCliOptions arg parser in config/scripts/rebuild-native-deps.mjs when it encounters a CLI token that is not one of the recognized flags (--force, --platform, --platform=, --arch, --arch=). The parser is intentionally strict so typos fail loudly instead of being silently ignored. After all known-flag branches at lines 349-368 are exhausted, line 369 throws for the unknown token.

Source

Thrown at config/scripts/rebuild-native-deps.mjs:369

      continue
    }
    if (arg === '--platform') {
      options.platform = readRequiredArgValue(args, (index += 1), '--platform')
      continue
    }
    if (arg.startsWith('--platform=')) {
      options.platform = readInlineArgValue(arg, '--platform')
      continue
    }
    if (arg === '--arch') {
      options.arch = readRequiredArgValue(args, (index += 1), '--arch')
      continue
    }
    if (arg.startsWith('--arch=')) {
      options.arch = readInlineArgValue(arg, '--arch')
      continue
    }
    throw new Error(`Unknown argument: ${arg}`)
  }
  return options
}

function readRequiredArgValue(args, index, flag) {
  const value = args[index]
  if (!value || value.startsWith('--')) {
    throw new Error(`Missing value for ${flag}`)
  }
  return value
}

function readInlineArgValue(arg, flag) {
  const value = arg.slice(`${flag}=`.length)
  if (!value) {
    throw new Error(`Missing value for ${flag}`)
  }
  return value

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Remove the unsupported flag — the script only accepts --force, --platform[=value], --arch[=value].
  2. Check the spelling of the flag you intended (--platform, not --platfrom).
  3. Pass --help-less usage by reading the parser at lines 345-372 if unsure which flags exist.

Example fix

// before
node config/scripts/rebuild-native-deps.mjs --target=x64

// after
node config/scripts/rebuild-native-deps.mjs --arch x64
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = new Set(['--force', '--platform', '--arch'])
for (const arg of args) {
  const head = arg.split('=')[0]
  if (arg.startsWith('--') && !KNOWN.has(head)) {
    throw new Error(`Unknown argument: ${arg}. Supported: --force, --platform[=], --arch[=]`)
  }
}

Type guard

const KNOWN_FLAGS = new Set(['--force', '--platform', '--arch'])
function isKnownFlag(arg) {
  return KNOWN_FLAGS.has(arg) || KNOWN_FLAGS.has(arg.split('=')[0]) && arg.includes('=')
}

Prevention

When it happens

Trigger: Run `node config/scripts/rebuild-native-deps.mjs --verbsoe` (typo), `--verbose`, `--target=x64`, or any unsupported flag. Only --force, --platform[=], and --arch[=] are accepted.

Common situations: A developer assumes the script shares flags with @electron/rebuild or electron-builder (e.g. --target, --types, --dir) and passes one of those. Typos like `--platfrom` are the other common cause.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/0cdf91ce212b2a0a. Report an issue: GitHub.