Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js nodejs gmail api不支持承诺_Node.js_Gmail Api - Fatal编程技术网

Node.js nodejs gmail api不支持承诺

Node.js nodejs gmail api不支持承诺,node.js,gmail-api,Node.js,Gmail Api,谷歌,但它的代码示例没有,我正在努力使gmail api在我修改源代码时能够与承诺一起工作 我只更改了下面的几行,但我得到了一个错误 VM677:5未捕获类型错误:gmail.users.messages.list(…)。then不是函数 大多数的使用承诺,所以我认为这应该是可能的,但我看不出问题是什么。非常欢迎提供帮助。googleapis模块不支持承诺 如果您想在本模块中使用承诺,请考虑使用 var list = util.promisify(gmail.users.messages.lis

谷歌,但它的代码示例没有,我正在努力使gmail api在我修改源代码时能够与承诺一起工作

我只更改了下面的几行,但我得到了一个错误

VM677:5未捕获类型错误:gmail.users.messages.list(…)。then不是函数


大多数的使用承诺,所以我认为这应该是可能的,但我看不出问题是什么。非常欢迎提供帮助。googleapis模块不支持承诺

如果您想在本模块中使用承诺,请考虑使用

var list = util.promisify(gmail.users.messages.list);

list({
    auth: auth,
    userId: 'me',
    labelIds: 'Label_14'
})
.then(...);

我添加了一个链接到一个例子,你看到的是错误的文档。这个链接(关于承诺)指的是。你正在使用;其文件明确表示不支持承诺。承诺支持于2018年3月添加:
var list = util.promisify(gmail.users.messages.list);

list({
    auth: auth,
    userId: 'me',
    labelIds: 'Label_14'
})
.then(...);