0
我正在嘗試使用highland與heroku-client結合使用。但在Heroku客戶端的內部,它使用this
,即使我嘗試bind
來綁定這個,函數給出了錯誤消息,並且有一個對於this
的錯誤消息,我無法使其工作。結合使用高地與節點客戶端
沒有權代碼看起來像這樣
const Heroku = require('heroku-client');
const hl = require('highland');
var hk = new Heroku({
token: process.env.HEROKU_API_TOKEN
});
var list = hl.wrapCallback(hk.apps().list.bind(hk));
list().toArray((a) => 'console.log(a)')
所以這個代碼片斷失敗,出現以下錯誤信息:
...node_modules/heroku-client/lib/resourceBuilder.js:35
if (this.params.length !== pathParams.length) {
^
TypeError: Cannot read property 'length' of undefined
這作品。唯一要提到的是從我的問題中複製粘貼,我在這裏執行'(a)=>'console.log(a)''而不是'(a)=> console.log(a)'。 –