Reputation: 780
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
Upvotes: 2
Views: 709
Reputation: 83
try it:
const {google} = require('googleapis');
const OAuth2 = google.auth.OAuth2;
Upvotes: 5