gpt4 book ai didi

node.js - 带有嵌套提示的 Yeoman.io 在 Inquirer.js 中产生未定义的错误

转载 作者:太空宇宙 更新时间:2023-11-03 22:17:38 26 4
gpt4 key购买 nike

我正在创建我的第一个(真正的)Yeoman.io 生成器,它有一些嵌套提示(即一个提示的答案会影响其他提示和操作的呈现)。

我已经追踪了我的代码,表面上看起来我正在适本地“打开和关闭”我的提示,但在脚本的最后,看起来仍然有一个打开的阅读行(来自 Inquirer.txt)。 js),并且在阅读行关闭后会触发额外的 onCompletion。

我假设这不是库(Yeoman.io 或 Inquirer.js)的问题,而是我提示的方式有问题,或者有不同的方法可以做到这一点我正在努力做。

INQUIRER onCompletion
Prompted for initialize, user said true
User said to initialize, exec git init
INQUIRER onCompletion
INQUIRER ERROR: TypeError: Cannot call method 'removeListener' of null
GITHOOKS PROMPT: undefined
GITHOOKS PROMPT: undefined

/untethered/app/index.js:178
cb();
^
TypeError: undefined is not a function
at UntetheredGenerator.<anonymous> (/untethered/app/index.js:178:3)
at Object.<anonymous> (/untethered/node_modules/yeoman-generator/node_modules/inquirer/lib/inquirer.js:88:7)

代码在这里:https://github.com/pollensoft/untethered/blob/master/app/index.js

最佳答案

已修复:github.com/pollensoft/untethered/commit/… 所以 8 小时内不会让我回答自己的问题。如果我忘记回来,这可能会显得没有答案。堆栈溢出之路! :)

关于node.js - 带有嵌套提示的 Yeoman.io 在 Inquirer.js 中产生未定义的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20332168/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com