【问题标题】:Warning you must upgrade to the latest version of google-spreadsheet警告您必须升级到最新版本的 google-spreadsheet
【发布时间】:2020-10-15 06:44:45
【问题描述】:

当我从谷歌电子表格中获取一些数据并插入数据库时​​,我正在尝试实施一个项目。插入零件对我来说并不重要。当我试图从谷歌电子表格文档中获取数据时,我收到了这个警告!

 WARNING! You must upgrade to the latest version of google-spreadsheet!
 Google's deprecation date for the v3 sheets API is March 3rd 2020
 Bad news - this version of this module will stop working on that date :(
 Good news - the new version of the module uses the newer v4 api :)
 However, there are breaking changes, so please see the docs site
 https://theoephraim.github.io/node-google-spreadsheet

它仍然给我数据,但我收到了警告。 有人知道我该如何摆脱该警告?

【问题讨论】:

  • 你能把代码放在这里吗?
  • @JeremyThille 我尝试安装最新版本,但我的程序不再工作了:)))。显然 vesion google-spreadsheet@2.0.6 没有这个警告。所以我推荐 npm install google-spreadsheet@2.0.6
  • @AmitKadivar 非常感谢您有时间回答,但我找到了摆脱该警告的方法。反正。有一个 lib 版本警告。
  • 无论如何,谢谢你的时间和兴趣来帮助我
  • 请编辑您的问题并包含您的代码。我们需要看看是什么给了你这个错误请确保你使用正确的谷歌表格 api developers.google.com/sheets/api/quickstart/nodejs

标签: javascript node.js google-sheets google-api


【解决方案1】:

Google Sheets API 已从 v3 升级到 v4

什么意思?

  • 表示认证客户端的某些方法名称、参数和构建发生了变化。
  • 如果您使用的是基于 v3 的旧代码,则将身份验证客户端构建为 const sheets = google.sheets({version: 'v3', auth});,您的代码将在不久的将来停止工作
  • 虽然 Google 将 2020 年 3 月 3 日指定为弃用日期,但仍有一些宽限期,但您的代码可能随时停止工作!
  • 所以,请将您的代码更改为const sheets = google.sheets({version: 'v3', auth});
  • 如有必要,根据quickstart for v4 中提供的新程序调整身份验证流程的其他部分
  • 通过references 查看您使用的任何请求是否已更改并根据需要进行调整。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-26
    • 2012-04-21
    • 2022-01-05
    • 2019-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多