Google-api-nodejs-client: Using async/await on googleapi libraries return undefined

Created on 21 Aug 2018  路  3Comments  路  Source: googleapis/google-api-nodejs-client

Please help, here is the codes:

OAuth2Client.setCredentials(tokens)
const oauth2 = google.oauth2({ version: "v2", auth: OAuth2Client })
const userinfo = await oauth2.userinfo.v2.me.get({})
console.log(userinfo)

userinfo is undefined in console log and either some other libraries are.
I'm using [email protected] and [email protected]

this has accidentally happened, it was running well yesterday...
Is it a bug or am I doing something wrong?

Most helpful comment

@JustinBeckwith
Yes you are right, I had old version. Updated to v.40 and everything ok.
Thanks.

All 3 comments

@hainguyents13
I have the same issue ( What is wrong ?

This usually happens when you're using a super old version of the library :) Can you check that you're on version 40?

@JustinBeckwith
Yes you are right, I had old version. Updated to v.40 and everything ok.
Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ashishbajaj99 picture ashishbajaj99  路  3Comments

Chethandsagar picture Chethandsagar  路  4Comments

JustinBeckwith picture JustinBeckwith  路  3Comments

peterpme picture peterpme  路  3Comments

leecheve picture leecheve  路  3Comments