Skip to content

Published npm package has duplicate option registration causing crash #64

@travis-burmaster

Description

@travis-burmaster

Bug

The published npm package (@open-gitagent/gitagent) crashes immediately on any command due to duplicate requiredOption calls in the compiled dist/ files.

Error

Error: Cannot add option '-f, --format <format>' to command 'export' due to conflicting flag '--format'
- already used by option '-f, --format <format>'

After patching that, a second crash occurs:

Error: Cannot add option '--from <format>' to command 'import' due to conflicting flag '--from'
- already used by option '--from <format>'

Affected files (in published dist)

  • dist/commands/export.js — line 9-10 both call .requiredOption('-f, --format <format>', ...)
  • dist/commands/import.js — line 453-454 both call .requiredOption('--from <format>', ...)

Source is already fixed

The TypeScript source on main has the correct single calls. The issue is that the latest npm publish was done before this fix, so the compiled output still has the duplicates.

Resolution

A new npm release should resolve this.

Environment

  • @open-gitagent/gitagent installed via npm i -g @open-gitagent/gitagent
  • Node.js v25.8.2
  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions