Skip to content
Latchkey

scancode "no such option" unknown flag in CI

ScanCode Toolkit stopped with "Error: no such option" because a command-line flag in your CI invocation is not recognized by the installed scancode version. Options change across major releases.

What this error means

scancode exits 2 immediately with "Error: no such option: --<flag>". Nothing is scanned. It usually appears after a scancode-toolkit upgrade or a copied command from older docs.

Terminal
Usage: scancode [OPTIONS] <OUTPUT FORMAT OPTION(s)> <input>...
Try 'scancode -h' for help.

Error: no such option: --license-score

Common causes

The flag was renamed or removed

ScanCode renamed several options across major versions. A command written for an older release passes a flag the new binary does not define.

A typo in the option name

A misspelled long option (or wrong number of dashes) is parsed as unknown and rejected before scanning starts.

How to fix it

Check the flags for the installed version

  1. Run scancode --version to see which release CI uses.
  2. Run scancode -h to list the options that version actually supports.
  3. Replace the removed flag with its current equivalent.
Terminal
scancode --version
scancode -h | grep -i license

Pin the ScanCode version

Install a fixed scancode-toolkit version in CI so option names stay stable and upgrades are deliberate.

Terminal
pip install "scancode-toolkit==32.1.0"
scancode --license --json-pp out.json ./src

How to prevent it

  • Pin scancode-toolkit and bump it on purpose, reading the changelog.
  • Keep the invocation in a script so flags are reviewed on change.
  • Prefer scancode -h output over copied commands from old tutorials.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →