【发布时间】:2019-04-18 00:11:30
【问题描述】:
在执行文档的代码时 https://developers.google.com/sheets/quickstart/nodejs?fbclid=IwAR0KmCnMNwsPkzuB93pB8YKaWot7IkAtxWqgLANR1Z08kuRKSl-r3DbqMrY#step_3_set_up_the_sample ,放上网址的key后(google账号进行认证)
出现此错误:
node: 5868) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: C
llback must be a function
in maybeCallback (fs.js: 129: 9)
in Object.writeFile (fs.js: 1156: 14)
in storeToken (C: \ Users \ ELIOT \ Desktop \ demoDialoglow \ api.js: 100: 6)
in C: \ Users \ ELIOT \ Desktop \ demoDialoglow \ api.js: 79: 7
in getTokenAsync.then.r (C: \ Users \ ELIOT \ Desktop \ demoDialoglow \ node_modules \ go
gle-auth-library \ build \ src \ auth \ oauth2client.js: 97: 51)
in process._tickCallback (internal / process / next_tick.js: 68: 7)
node: 5868) UnhandledPromiseRejectionWarning: Rejection of uncontrolled promise. This e
Ror originated either by throwing inside an asynchronous function without a capture bl
ck, or rejecting a promise that was not handled with .catch (). (Rejection ID
one)
node: 5868) [DEP0018] DeprecationWarning: unmanaged promise rejects are obsolete
In the future, rejections of promise that are not handled will end the N
Process .js with a non-zero exit code.
【问题讨论】:
-
这就是你的全部代码吗?你知道是哪一行触发了错误吗?
-
你可能需要也可能不需要在 Github 上报告问题
-
所有代码都在链接中
-
我看了,但我没有在其中的任何地方找到任何
setToken函数 -
对不起,我的意思是
storeToken