yeoman not installing on particular version of node and npm

1.4k Views Asked by At

I am trying to install yo on my ubuntu 18.04LTS but unable to do so,I've to use npm 5.x and nodejs version 8.9.x explicitly and yo is compatible with these version but still its showing this error but if I update my node and npm to latests , I'm able to install it.I'm not able to figure this out by myself.can someone help?

Yeoman Doctor
Running sanity checks on your system

    ✔ No .bowerrc file in home directory
    ✔ Global configuration file is valid
    ✔ NODE_PATH matches the npm root
    ✔ No .yo-rc.json file in home directory
    ✔ Node.js version
    ✔ npm version
    { Error: Command failed: yo --version
    /home/bikrant/.nvm/versions/node/v8.9.1/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:534
          } catch {
                  ^
    
    SyntaxError: Unexpected token {
        at createScript (vm.js:80:10)
        at Object.runInThisContext (vm.js:139:10)
        at Module._compile (module.js:599:28)
        at Object.Module._extensions..js (module.js:646:10)
        at Module.load (module.js:554:32)
        at tryModuleLoad (module.js:497:12)
        at Function.Module._load (module.js:489:3)
        at Module.require (module.js:579:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (/home/bikrant/.nvm/versions/node/v8.9.1/lib/node_modules/yo/lib/router.js:8:27)
    
        at ChildProcess.exithandler (child_process.js:275:12)
        at emitTwo (events.js:126:13)
        at ChildProcess.emit (events.js:214:7)
        at maybeClose (internal/child_process.js:925:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) killed: false, code: 1, signal: null, cmd: 'yo --version' }
    ✖ yo version
    { Error: Command failed: yo --version
    /home/bikrant/.nvm/versions/node/v8.9.1/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:534
          } catch {
                  ^
    
    SyntaxError: Unexpected token {
        at createScript (vm.js:80:10)
        at Object.runInThisContext (vm.js:139:10)
        at Module._compile (module.js:599:28)
        at Object.Module._extensions..js (module.js:646:10)
        at Module.load (module.js:554:32)
        at tryModuleLoad (module.js:497:12)
        at Function.Module._load (module.js:489:3)
        at Module.require (module.js:579:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (/home/bikrant/.nvm/versions/node/v8.9.1/lib/node_modules/yo/lib/router.js:8:27)
    
        at ChildProcess.exithandler (child_process.js:275:12)
        at emitTwo (events.js:126:13)
        at ChildProcess.emit (events.js:214:7)
        at maybeClose (internal/child_process.js:925:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) killed: false, code: 1, signal: null, cmd: 'yo --version' }
    
    Found potential issues on your machine :(
    + [email protected]
    
    
    
     
0

There are 0 best solutions below