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 valueView on GitHub (pinned to 1136503c6a)
Solutions
- Remove the unsupported flag — the script only accepts --force, --platform[=value], --arch[=value].
- Check the spelling of the flag you intended (--platform, not --platfrom).
- 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
- Only --force, --platform[=value], --arch[=value] are accepted — do not pass @electron/rebuild flags.
- Double-check flag spelling (--platform, not --platfrom).
- Prefer the inline `--flag=value` form to reduce next-slot errors.
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
- Missing value for ${flag}
- Electron builds are not available on platform: ${targetPlatf
- Usage: node config/scripts/release-rc-history.mjs <base-vers
- Invalid --serve-port value: ${rawPort}
- --serve-project-root must be absolute: ${options.projectRoot
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/0cdf91ce212b2a0a.
Report an issue: GitHub.