gpt4 book ai didi

javascript - 将 google-api-nodejs-client 与 browserify 捆绑在一起不起作用

转载 作者:行者123 更新时间:2023-11-30 10:14:40 25 4
gpt4 key购买 nike

我正在尝试使用 google-api-nodejs-client 构建客户端应用程序使用浏览器化。看起来它内部正在尝试使用 fs 模块读取一些 mime 类型的信息,但在浏览器中无法读取。

    // Load additional types from node.js community
mime.load(path.join(__dirname, 'types/node.types'));

// Default type
mime.default_type = mime.lookup('bin');

有没有人使用这个 API 进行客户端开发?

最佳答案

此问题已得到解决并关闭 here on GitHub .

fs is not available from the browser, unfortunately. This library is specifically designed and implemented for server-side development and is unsupported for client-side development.

Check out https://developers.google.com/api-client-library/javascript/ which is designed for JavaScript client-application developers.

关于javascript - 将 google-api-nodejs-client 与 browserify 捆绑在一起不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24520213/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com