CNode

为什么我的 node --harmony index.js 启动后,还是报错 不认识es6的语法

问答
Yyyp544784013发布于12 年前最后回复12 年前0 回复13349 浏览0 收藏

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

查看回复

回复 (0)

暂无回复,成为第一个参与讨论的人。
参与回复
登录后即可参与回复。登录