【问题标题】:Yeoman fails to runYeoman 无法运行
【发布时间】:2018-08-25 00:25:07
【问题描述】:

我在 centos 7 上,我刚刚安装了 nodejs 版本 6.14.3、npm 版本 3.10.10 和 yo 版本 2.0.5。然后我运行命令

yo code

尝试使用 yeoman 生成器创建 vscode 扩展。然后我收到以下错误:

/usr/lib/node_modules/generator-code/generators/app/index.js:47
async prompting() {
      ^^^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.get [as code:app] (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/store.js:39:27)

不确定我是否只是缺少一个愚蠢的依赖或其他东西。有什么想法吗?

【问题讨论】:

    标签: node.js visual-studio-code yeoman-generator


    【解决方案1】:

    此节点版本 6.X 不支持 asyncs。

    一定要安装较新的版本,我建议至少 8.X 以免在语言级别上冒其他不兼容的风险。

    【讨论】:

    • 谢谢,我实际上是在发布后用一些谷歌魔法才弄明白的。
    猜你喜欢
    • 2018-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-04
    • 2016-06-14
    • 2015-04-15
    • 2015-04-24
    相关资源
    最近更新 更多