node.js - 我怎样才能使用 googleapis 来 react native ?

标签 node.js react-native google-api google-drive-api

目前,我正在尝试将 google drive API v3 用于 React Native。我以 google drive API v3 Node.js 为例.但问题是当我尝试将 googleapis 导入我的项目时,它显示以下错误。

enter image description here

我用谷歌搜索了很多次,但找不到解决方案。谁能帮我解决这个问题?

最佳答案

Google Drive 的 Node.JS API 使用 Node 的内置 path 模块。除了开发者工具,React Native is not built on top of Node - 它利用了 Safari 的 JavaScript 引擎 JavaScriptCore。因此,当您运行您的应用程序时,path 模块不存在,API 客户端将无法工作。

您需要使用 the REST API直接与 Google 通信。

关于node.js - 我怎样才能使用 googleapis 来 react native ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44327592/

相关文章:

javascript - 使用 google drive api 上传 excel 文件

node.js - 在 Nightwatch.js 命令中使用 XPath 来选择 Polymer Element 的子元素?

javascript - 即使 __DEV__ 为 false,react-native 中的 console.error 也会引发红屏

javascript - Twitter Stream.on 意外的代币 E

ios - 异步函数运行(){ ^^^^^^^^ SyntaxError : Unexpected token function

javascript - react native 错误 : undefined is not an object (evaluating 'Object.keys(dataBlob[sectionID])' )

android - 如何在 Jetpack Compose 中观察 Mu​​tableStateFlow 列表

php - Google 本地搜索超过 7 个结果?

java - 在 Node 中读取 Java 生成的公钥

javascript - 如何解析这些字符串响应以使用一些提取的值执行一些计算