Himanshu Teotia
Himanshu Teotia

Reputation: 2185

Using google oauth2 for spreadsheets getting an error "google.sheets is not a function"

var sheets = google.sheets('v4'); ^ TypeError: google.sheets is not a function

I am using this startup tutorial Node.js Quickstart for Google spreadsheets. Is anyone else also facing this problem?

Upvotes: 7

Views: 2755

Answers (1)

Himanshu Teotia
Himanshu Teotia

Reputation: 2185

The issue is resolved. This issue was coming because of Google's API version v4 :

Need to use like var { google } = require("googleapis")

Thank you @Tanaike

Upvotes: 15

Related Questions