小编Mk-*_*ger的帖子

async wait 不适用于 Node.js gdrive API v3

希望你能帮我解决这个问题。很困惑为什么这会给我带来问题。

按照快速入门指南,我能够将文件打印到控制台。酷,我看到第二个参数files.list是传入的回调res/error

节点:v8.3.0 npm:v5.3.0

const { google } = require('googleapis');
const express = require('express');
const fs = require('fs');
const keys = require('./credentials.json');

const app = express();

const drive = google.drive('v3');

const scopes = [
  "https://www.googleapis.com/auth/drive",
  "https://www.googleapis.com/auth/drive.file",
  "https://www.googleapis.com/auth/drive.metadata.readonly"
];

// Create an oAuth2 client to authorize the API call
const client = new google.auth.OAuth2(
  keys.web.client_id,
  keys.web.client_secret,
  keys.web.redirect_uris[0]
);

// Generate the url that will be used for authorization
this.authorizeUrl = client.generateAuthUrl({
  access_type: 'offline',
  scope: scopes
});

// Open …
Run Code Online (Sandbox Code Playgroud)

node.js google-drive-api google-drive-shared-drive

2
推荐指数
1
解决办法
2411
查看次数