node koa2

http://www.codes51.com/itwd/4316421.html

 

问题: (node.js)nodejs koa ctx=> 报错
描述:

刚开始接触 koa 一直提示 ctx=> 这个>报错 无法运行 实在弄不清了 也找不到资料 求大神帮忙
这是报错
app.use(ctx => {

 

SyntaxError: Unexpected token >

at exports.runInThisContext (vm.js:69:16)
at Module._compile (module.js:432:25)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Function.Module.runMain (module.js:490:10)
at startup (node.js:124:16)
at node.js:803:3

解决方案:Node版本过低
Koa 依赖 node v7.6.0 或 ES2015及更高版本和 async 方法支持.
posted @ 2018-04-18 23:02  zhaobao1830  阅读(112)  评论(0编辑  收藏  举报