Skip to content

fix(generators): register 'list' prompt type alias for newer inquirer…#3688

Open
rawestmoreland wants to merge 1 commit into
feathersjs:dovefrom
rawestmoreland:fix/inquirer-list-prompt-type
Open

fix(generators): register 'list' prompt type alias for newer inquirer…#3688
rawestmoreland wants to merge 1 commit into
feathersjs:dovefrom
rawestmoreland:fix/inquirer-list-prompt-type

Conversation

@rawestmoreland

@rawestmoreland rawestmoreland commented Jun 3, 2026

Copy link
Copy Markdown

Summary

  • Problem: Running npx @feathersjs/cli generate app (or any generator command) fails on newer installations with:

    Error: Prompt type "list" is not registered. Available prompt types: checkbox, confirm, editor, expand, input, number, password, rawlist, search, select
    

    The root cause is a breaking change in inquirer introduced in a post-9.3.x release: the list prompt type was renamed to select. Because @featherscloud/pinion declares "inquirer": "^9.3.2", npm can resolve a newer version where list no longer exists — but all generator prompts use type: 'list'. The issue only manifested on global/npx installs where npm resolved the newer inquirer; local monorepo dev happened to pin to 9.3.8 (which still has list), masking it.

  • Fix: Added a one-time compatibility shim in packages/generators/src/commons.ts that runs at module load. It accesses the inquirer prompt singleton via pinion's getConfig() and, if list is not registered but select is, registers list as an alias using registerPrompt. No prompt definitions were changed — generators continue to use type: 'list' and work regardless of which inquirer version npm resolves.

  • Related issues: None found, but this affects anyone running the CLI via npx or a fresh global install where npm resolves a newer inquirer 9.x.

  • Dependent PRs in other repos: None. The fix is self-contained in @feathersjs/generators.

Other Information

The shim is a two-line guard that is a no-op on older inquirer versions that already have list, so there is no regression risk for existing installations:

const { prompt: pinionPrompt } = getConfig()
if (!pinionPrompt.prompts?.list && pinionPrompt.prompts?.select) {
  pinionPrompt.registerPrompt('list', pinionPrompt.prompts.select)
}

@rawestmoreland rawestmoreland marked this pull request as ready for review June 3, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant