Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Invalid inquirer API access when running `npx all-contributors init` with v7.0.0

Aperta Adatta ai principianti
#586 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
cli

Direzione di ricerca

Inizia leggendo le definizioni dei prompt in dist/cli.js e dist/init/prompt.js, soprattutto i tre punti di chiamata indicati nel report, e controlla come il progetto gestisce i test CLI. Riproduci il problema con npx all-contributors o npx all-contributors init usando Inquirer 14. Il problema è risolto quando i prompt interessati vengono visualizzati ed entrambi i comandi proseguono senza un errore di tipo di prompt sconosciuto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

[!NOTE]
I have ran into this issue after upgrading from [email protected] to the latest v7 release.

I have asked LLM to perform an initial debug and generate the following report, which I have manually checked and modified for clarity.

Describe the bug

In v7.0.0, every interactive prompt that uses type: 'list' crashes with:

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

[email protected] depends on inquirer ^14.0.2, but the source still asks for the list prompt type, which inquirer 14 no longer registers (the replacement is select). The affected call sites are:

  • dist/cli.js:155 (the "What do you want to do?" menu, shown when no command is given)
  • dist/init/prompt.js:21 (repository type, used by init)
  • dist/init/prompt.js:86

In practice, running all-contributors with no command, or running all-contributors init, fails as soon as it reaches one of these prompts.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new directory and install the CLI:
    mkdir ac-repro && cd ac-repro
    git init && git remote add origin https://github.com/example/repo.git
    npm init -y
    npm i [email protected]
    
  2. Run the CLI without a command: npx all-contributors
  3. See the error:
    UnknownPromptTypeError: Prompt type "list" is not registered. Available prompt types: checkbox, confirm, editor, expand, input, number, password, rawlist, search, select
        at PromptsRunner.prepareQuestion (.../node_modules/inquirer/dist/ui/prompt.js:156:19)
        at PromptsRunner.fetchAnswer (.../node_modules/inquirer/dist/ui/prompt.js:202:37)
        at PromptsRunner.run (.../node_modules/inquirer/dist/ui/prompt.js:118:47)
        at async run (.../node_modules/all-contributors-cli/dist/cli.js:184:21)
    

npx all-contributors init fails the same way once it reaches the "What is the repository type?" question.

Expected behavior

The prompts render and the command continues. Either the list prompt types should be changed to select, or the inquirer dependency should stay on a version that still registers list.

Screenshots

Not applicable, the full error output is above.

Additional context

  • Resolved version: [email protected]
  • Node.js: v24.22.1
  • I checked whether list is registered in each major by calling inquirer.prompt([{ type: 'list', ... }]). Inquirer 12 and 13 render the prompt, and inquirer 14 throws UnknownPromptTypeError. So the break comes from the ^14.0.2 range in 7.0.0.
  • [email protected] (which depends on inquirer ^7.3.3) does not have this problem.
  • 7.0.0 is currently the latest dist-tag on npm, so anyone who installs the package without pinning a version gets this.
Lingua principale
JavaScript
Stelle
424
Fork
151
Merge medio
2g 1h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di all-contributors/cli

Tutte le issue di all-contributors/cli

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.