API do Google Drive - Não é possível ler a propriedade 'OAuth2' de indefinida
Eu estou seguindoeste tutorial de início rápido para, eventualmente, poder baixar certos arquivos do meu aplicativo.
Ao seguir o tutorial, recebi o erroCannot read property 'OAuth2' of undefined
e vem dessa linha:
const fs = require('fs');
const readline = require('readline');
const google = require('googleapis');
const OAuth2Client = google.auth.OAuth2; << google.auth = undefined
const SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'];
const TOKEN_PATH = 'credentials.json';
// the rest of the code is exactly as it is in the tutorial
Eu já instalei o googleapis @ 27 e aqui está o meu package.json
{
"name": "temp-google-drive-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"googleapis": "^27.0.0"
}
}
Eu já relatei que para o Google, mas espero que isso seja feito hoje, alguém aqui enfrentou um problema semelhante?