我正试图按照本教程创建一个VS代码扩展:https://code.visualstudio.com/api/get-started/your-first-extension
我已经使用安装了yo和生成器代码
https://code.visualstudio.com/api/get-started/your-first-extension
当我运行yo code
时,我一直得到这个错误:
/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:69
filePatterns: lookups.flatMap(prefix => [`${prefix}/*/index.ts`, `${prefix}/*/index.js`, `${prefix}/*/index.cjs`, `${prefix}/*/index.mjs`]),
^
TypeError: lookups.flatMap is not a function
at Environment.resolver.lookup (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:69:27)
at init (/usr/local/lib/node_modules/yo/lib/cli.js:130:7)
at pre (/usr/local/lib/node_modules/yo/lib/cli.js:89:3)
at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:219:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
为什么会发生这种情况,有什么方法可以解决吗?
我认为,这是类似的问题。我建议你按照这里描述的步骤操作。:(