koa2 - node.js koa ctx=> 报错
阿神
阿神 2017-05-16 13:33:32
0
2
542

刚开始接触 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

这是源码
const Koa = require('koa');
const app = new Koa();

app.use(ctx => {
ctx.body = 'Hello Koa';
});

app.listen(3000);

console.log('app started at port 3000....');

阿神
阿神

闭关修行中......

人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!