yeoman / doctor

Detect potential issues with users system that could prevent Yeoman from working correctly
http://yeoman.io
BSD 2-Clause "Simplified" License
61 stars 17 forks source link

NPM Install issue as part of Yo #51

Open AFurryCat opened 4 years ago

AFurryCat commented 4 years ago

I get the following whilst running npm i -g yo

[user@ip ~]$ npm i -g yo
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
/usr/bin/yo -> /usr/lib/node_modules/yo/lib/cli.js
/usr/bin/yo-complete -> /usr/lib/node_modules/yo/lib/completion/index.js

> core-js@3.6.5 postinstall /usr/lib/node_modules/yo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> ejs@2.7.4 postinstall /usr/lib/node_modules/yo/node_modules/ejs
> node ./postinstall.js

> spawn-sync@1.0.15 postinstall /usr/lib/node_modules/yo/node_modules/spawn-sync
> node postinstall

> yo@3.1.1 postinstall /usr/lib/node_modules/yo
> yodoctor

/usr/lib/node_modules/yo/node_modules/yeoman-doctor/lib/index.js:12
  (async () => {
         ^

SyntaxError: Unexpected token (
    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.<anonymous> (/usr/lib/node_modules/yo/node_modules/yeoman-doctor/lib/cli.js:3:1)
/usr/lib
└── (empty)

npm ERR! Linux 3.10.0-1127.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "-g" "yo"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! yo@3.1.1 postinstall: `yodoctor`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yo@3.1.1 postinstall script 'yodoctor'.

Doesn't look to be anything I can fix on the local machine, happy to be proven otherwise!

LitoMore commented 4 years ago

See here:

https://github.com/yeoman/doctor/blob/master/package.json#L14

Doctor requires Node.js 8 or later. But you are using Node.js 6.17.1.