我正在使用nodejs编写命令行工具。 Windows报告错误。在Linux和Mac OSX系统上没有问题。
https://www.npmjs.com/package/idoc
全球安装npm install idoc -g
。运行idoc init
命令。您可以重现此错误。依赖项inquirer错误。
C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:549
throw e;
^
TypeError: Cannot read property 'substring' of undefined
at Interface.rl._getCursorPos (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\ node_modules\readline2\index.js:55:51)
at ScreenManager.render (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\lib\ut ils\screen-manager.js:19:27)
at Prompt.render (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\lib\prompts\i nput.js:75:15)
at Prompt._run (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\lib\prompts\inp ut.js:49:8)
at Prompt.run (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\lib\prompts\base .js:57:8)
at Object.<anonymous> (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\lib\ui\p rompt.js:83:12)
at module.exports (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\node_modules \run-async\index.js:15:21)
at C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\lib\utils\utils.js:16:7
at tryCatcher (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\node_modules\rx- lite\rx.lite.js:537:29)
at setDisposable (C:\Documents and Settings\Administrator\Application Data\npm\node_modules\idoc\node_modules\inquirer\node_modules\ rx-lite\rx.lite.js:5380:36)