安装yeoman的问题

问题描述 投票:0回答:1

我正在尝试通过节点4.8.7安装yeoman。

npm install -g yo

这是我得到的错误:

C:\Users\thomas\AppData\Roaming\nvm\v4.8.7\node_modules\yo\node_modules\yeoman-doctor\lib\index.js:12
      (async () => {
             ^

    SyntaxError: Unexpected token (
        at exports.runInThisContext (vm.js:53:16)
        at Module._compile (module.js:373:25)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Module.require (module.js:353:17)
        at require (internal/module.js:12:17)
        at Object.<anonymous> (C:\Users\thomas\AppData\Roaming\nvm\v4.8.7\node_modules\yo\node_modules\yeoman-doctor\lib\cli.js:3:1)
        at Module._compile (module.js:409:26)
        at Object.Module._extensions..js (module.js:416:10)
    npm ERR! Windows_NT 10.0.18362
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
"--global" "yo"
    npm ERR! node v4.8.7
    npm ERR! npm  v2.15.11
    npm ERR! code ELIFECYCLE

    npm ERR! [email protected] postinstall: `yodoctor`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] postinstall script 'yodoctor'.
    npm ERR! This is most likely a problem with the yo package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     yodoctor
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs yo
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!
    npm ERR!     npm owner ls yo
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\Users\thomas\dev\workspace\aprhtechvalley\npm-debug.log

知道如何解决此问题?

谢谢

node.js npm yeoman
1个回答
0
投票

请将您的NodeJS更新为最新版本,即12:https://nodejs.org/en/download/

© www.soinside.com 2019 - 2024. All rights reserved.