这个语法错误是什么?(测试Hapi.js)
What is this syntax error ? (Testing Hapi.js)
我只是想测试Hapi.js,无论我编码什么,我都会收到这个错误:
node_modules/hapi/lib/server.js:145
Items.serial(this.connections, (connectionItem, next) => {
^
SyntaxError: missing ) after argument list
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/gilles/exo1/node_modules/hapi/lib/index.js:5:16)
at Module._compile (module.js:430:26)
at Object.Module._extensions..js (module.js:448:10)
这个语法从哪里来。。。()=>{…生成函数?
我用哈皮做了什么坏事?
非常感谢
语法称为Arrow函数。您使用hapi 10或更高版本,它需要节点4+,但您有一个旧版本的节点,它还不支持箭头功能。解决方案是将节点版本升级到4或5。
相关文章:
- 模糊事件的Javascript测试
- 我的单元测试选项是什么
- 测试索引值是否等于某个数字的倍数
- 在localhost Dev Box上测试JSONP请求的最佳方式
- 测试数组中每个项的内容
- 测试Angular Service解决错误回调中的promise
- 使用Jest测试React Native应用程序
- 为函数代码编写测试
- 如何在Angular单元测试中从另一个控制器的rootScope将方法添加到rootScope中
- 如何使用JS/nightwatchjs并行运行多个测试
- 使用量角器的当前url单元测试的getTitle
- 茉莉花宝石-耙茉莉花:ci dons't运行测试
- JavaScript滚动脚本-在测试中激发,而不是在开发站点上
- AngularJS指令单元测试中未定义的函数
- 一个密码测试程序,如果存在空格,它会提醒用户
- 测试角度解析方法
- Protractor:在Iframe中测试非角度应用程序
- 简单类测试未通过
- 如何在Ionic2测试版中包含Ionic.io服务
- 这个语法错误是什么?(测试Hapi.js)