问题描述
我正在尝试在我的 ubuntu 18.04LTS 上安装 yo,但无法安装,我必须明确使用 npm 5.x 和 nodejs 版本 8.9.x,并且 yo 与这些版本兼容,但仍然显示此错误,但是如果我将 node 和 npm 更新为 latests ,我就可以安装它。我自己无法解决这个问题。有人可以帮忙吗?
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,cmd: 'yo --version' }
Found potential issues on your machine :(
+ yo@4.2.0
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)