目前,我正在尝试将 google drive API v3 用于 React Native。我以 google drive API v3 Node.js 为例.但问题是当我尝试将 googleapis 导入我的项目时,它显示以下错误。
我用谷歌搜索了很多次,但找不到解决方案。谁能帮我解决这个问题?
最佳答案
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/