我正在创建我的第一个(真实的) Yeoman.io生成器,它有一些嵌套的提示(即一个提示的回答会影响其他提示和操作的表示)。
我已经在代码中进行了跟踪,从表面上看,我似乎是在适当地“打开和关闭”我的提示,但是在脚本的最末尾,看起来仍然有一个开放的readline (来自Inquirer.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
发布于 2016-08-24 15:30:16
修正在这里:github.com/pollensoft/un期/commit/…所以不让我回答自己的问题8个小时。如果我忘了回来,这件事可能没人回答。“堆栈溢出”!:)
https://stackoverflow.com/questions/20332168
复制相似问题