Invalid inquirer API access when running `npx all-contributors init` with v7.0.0
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 byinit)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:
- 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] - Run the CLI without a command:
npx all-contributors - 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
listis registered in each major by callinginquirer.prompt([{ type: 'list', ... }]). Inquirer 12 and 13 render the prompt, and inquirer 14 throwsUnknownPromptTypeError. So the break comes from the^14.0.2range in 7.0.0. [email protected](which depends oninquirer ^7.3.3) does not have this problem.- 7.0.0 is currently the
latestdist-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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di all-contributors/cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
all-contributors/cli#587 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
all-contributors/cli#584 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Markdown provided in `types[key].link` is injected as-is into HTMLAnchorElement's href attributeForse già presa @theworker02 l’ha presa 34 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 61/100
all-contributors/cli#520 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Additional Config File OptionsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
all-contributors/cli#499 · 2 commenti · 6 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Consider adding a PR title checker to enforce angular / conventional commitsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertatype: ci type: enhancement type: infrastructure
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
all-contributors/cli#482 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di all-contributors/cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vercel/ai#24302 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
follow-redirects updateAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mailgun/mailgun.js#544 ·
-
beginner bug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
BistaDinesh03/critique#266 ·
I maintainer di solito rispondono entro 1 giorno
-
New tool: ⚪️ writenodeForse già presa @github-actions l’ha presa oggi. Apertasubmission triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
kausalflow/tools#251 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno