2

The below code is pasted from node.js quickstart of Google calender Api section.This code is not able to access auth from google API's.I copied the error below.To see full code you can access this link .Thanks for the help.

const google = require('googleapis');
const OAuth2Client = google.auth.OAuth2;

Error looks like this :

const OAuth2Client = google.auth.OAuth2; ^
TypeError: Cannot read property 'OAuth2' of undefined

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Kapil Yadav
  • 780
  • 1
  • 8
  • 15

1 Answers1

5

try it:

const {google} = require('googleapis'); const OAuth2 = google.auth.OAuth2;

a5r0n
  • 83
  • 5