stablyai/orca · error · Error

Missing value for ${flag}

Error message

Missing value for ${flag}

What it means

Thrown by readRequiredArgValue in config/scripts/rebuild-native-deps.mjs when a flag that expects a separate value (--platform or --arch) is followed by nothing, or by a token that itself starts with `--`. The parser reads the next argv slot as the value; if that slot is missing or looks like another flag, it refuses rather than silently consuming the wrong token.

Source

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

      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
}

function getElectronExecutablePath() {
  const platformPath = getElectronPlatformPath()
  return process.env.ELECTRON_OVERRIDE_DIST_PATH
    ? resolve(process.env.ELECTRON_OVERRIDE_DIST_PATH, platformPath)
    : resolve(electronPackageDir, 'dist', platformPath)
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Provide the value on the next slot: `--platform win32`, not bare `--platform`.
  2. Prefer the inline form `--platform=win32` to avoid next-slot ambiguity.
  3. Check the command for a lost line-continuation (trailing backslash) before the value.

Example fix

// before
node config/scripts/rebuild-native-deps.mjs --platform

// after
node config/scripts/rebuild-native-deps.mjs --platform win32
# or
node config/scripts/rebuild-native-deps.mjs --platform=win32
Defensive patterns

Strategy: validation

Validate before calling

// Before invoking, ensure every space-separated value-flag has a value
for (let i = 0; i < args.length; i++) {
  if ((args[i] === '--platform' || args[i] === '--arch') && (!args[i + 1] || args[i + 1].startsWith('--'))) {
    throw new Error(`Missing value for ${args[i]}`)
  }
}

Prevention

When it happens

Trigger: Run `... --platform` as the last argument, or `... --platform --arch x64` (the value slot is occupied by another flag). readRequiredArgValue at lines 374-379 sees `value` falsy or starting with `--` and throws at line 376-377.

Common situations: A copy-pasted command drops the value, a shell-quoting bug eats the argument, or a user expects `--platform` to default. Putting the value on the next line in a multi-line shell command that loses the continuation is another common source.

Related errors


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