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.
Usage: scancode [OPTIONS] <OUTPUT FORMAT OPTION(s)> <input>...
Try 'scancode -h' for help.
Error: no such option: --license-scoreCommon 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
- Run
scancode --versionto see which release CI uses. - Run
scancode -hto list the options that version actually supports. - Replace the removed flag with its current equivalent.
scancode --version
scancode -h | grep -i licensePin the ScanCode version
Install a fixed scancode-toolkit version in CI so option names stay stable and upgrades are deliberate.
pip install "scancode-toolkit==32.1.0"
scancode --license --json-pp out.json ./srcHow 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 -houtput over copied commands from old tutorials.