安装yeoman的问题

时间:2020-02-18 15:52:43

标签: node.js npm yeoman

我正尝试在节点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! 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'.
    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

有什么办法解决这个问题吗?

谢谢

1 个答案:

答案 0 :(得分:0)

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


或者,如果您需要通过NVM安装它:https://tecadmin.net/install-nodejs-with-nvm/

相关问题