【发布时间】:2016-07-27 05:30:16
【问题描述】:
let nasPath = "";
return getFamInfo(args.familyID)
.then(function (famInfo) {
nasPath = //some code involving famInfo here
return getSFTPConnection(config.nasSettings);
}).then(function (sftp) {
const fastPutProm = Promise.promisify(sftp.fastPut);
return fastPutProm(config.jpgDirectory, nasPath, {});
});
如果我在const fastPutProm = Promise.promisify(sftp.fastPut); 之后放置一个断点,fastPutProm 就是一个带有三个参数的函数。但是当我尝试运行这段代码时,我得到了一个TypeError: Cannot read property 'fastPut' of undefined 错误。我在这里做错了什么?
【问题讨论】:
标签: javascript node.js promise bluebird