为什么我的 node --harmony index.js 启动后,还是报错 不认识es6的语法
发布于 9 年前 作者 yyp544784013 12401 次浏览 最后一次编辑是 8 年前 来自 问答

nodejs 版本是v0.10.33, 环境是win8.1 diaosi@ER-GOU /E/study/koa-study (master) $ node --v8-options|grep harmony –harmony_typeof (enable harmony semantics for typeof) –harmony_scoping (enable harmony block scoping) –harmony_modules (enable harmony modules (implies block scoping)) –harmony_proxies (enable harmony proxies) –harmony_collections (enable harmony collections (sets, maps, and weak maps))

–harmony (enable all harmony features (except typeof))

$ node --harmony index.js

e:\study\koa-study\index.js:6 app.use(function *(next){ ^ SyntaxError: Unexpected token * at Module._compile (module.js:439:25) at Object.Module._extensions…js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

diaosi@ER-GOU /E/study/koa-study (master)

找到一个答案: 朴大的回答 Please use version > 0.11.3

回到顶部