YO - 意外的令牌错误

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

运行 yo 会出现无效令牌错误。目前使用的 Node、NPM 版本如下。 节点-v v4.5.0 npm-v 2.15.9

$ yo
node_modules/yo/node_modules/yeoman-environment/lib/resolver.js   
let lookup = path.join(...parts.slice(0, i + 1), 'node_modules');
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> 
yeoman yeoman-generator
2个回答
6
投票

移动到 node -v v8.11.1 和 npm -v 5.6.0 后一切正常


0
投票

确保您的节点主要版本与您安装 yeoman 使用的节点版本相匹配。

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