Search code examples
node.jsvisual-studio-codeyeoman-generator

Yeoman fails to run


I'm on centos 7 and I just installed nodejs version 6.14.3, npm version 3.10.10, and yo version 2.0.5. I then ran the command

yo code

In an attempt to use the yeoman generator to create a vscode extension. I then got the following error:

/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)

Not sure if I'm just missing a silly dependency or something. Any ideas?


Solution

  • This node version, 6.X, doesn't support asyncs.

    Definitely install a newer version, I recommend at least 8.X to not to risk other incompatibilities at the language level.