gpt4 book ai didi

javascript - 错误 : getaddrinfo EAI_AGAIN api. spotify.com:443

转载 作者:行者123 更新时间:2023-12-01 15:47:24 25 4
gpt4 key购买 nike

虽然我正在整合 Spotify API进入 Google Assistant应用程序,实现 Account Linking ,

getaddrinfo EAI_AGAIN api.spotify.com:443



上述错误一直在控制台中出现,尽管它似乎正在工作,就像 API 实现没有任何问题一样。访问 token 已正确创建和接收,客户端和 secret ID 已填写,没有任何拼写错误。另外,我在 Spotify Console 上测试了 API 调用。 ( https://developer.spotify.com/console/get-artist-albums/)。没有发现错误。它从 Spotify 服务器获取了预期的数据,因此它不应该与 Account Linking 相关。和 Spotify Server .我自己创建的代码如下:我认为 spotify-web-api-node 周围有问题, node , npm , 或 firebase-functions ??我最近做了 Node 版本控制,所以我可能做错了什么。
  • Node 版本:v7.9.0
  • spotify-web-api-node: ^4.0.0
  • firebase 功能:^2.0.3
  • npm 版本:6.4.1
  • 添加引擎:{ "node": "8"} //这是在 package.json 中使用 asyn 和 await


  • app.intent(SomeIntent, async (conv, params) => {
    console.log('user info', JSON.stringify(conv.user));
    conv.ask('lets play'); //okay
    const access_token = conv.user.access.token || ''; // okay
    console.log('Your TOKEN information here: ' + access_token); // okay
    spotifyApi.setAccessToken(access_token); // should be set correctly
    let data = await findMusic(); // error in the findMusic func
    conv.ask('found this song。', data.name); // so no data.name
    });

    function findMusic() {
    return spotifyApi.getArtistAlbums('43ZHCT0cAZBISjO8DG9PnE').then((data) => {
    console.log('artist song', data.body);
    return data.body; //this does not return because error is produced
    }).catch(err => {
    console.log('Something went wrong!', err);
    return err; // this error is WebapiError: getaddrinfo EAI_AGAIN api.spotify.com:443
    });
    }


    更新

    @Nick-Felker 在下面的评论中提到,只能通过付费计划进行外部调用。所以这可能是解决方案(因为我没有使用付费计划,所以现在没有证明是有效的。下面的详细解释引用自 An answer comment from another StackOverflow post

    The Spark plan allows outbound network requests only to Google-owned services. Inbound invocation requests are allowed within the quota. On the Blaze plan, Cloud Functions provides a perpetual free tier. The first 2,000,000 invocations, 400,000 GB-sec, 200,000 CPU-sec, and 5 GB of Internet egress traffic is provided for free each month. You are only charged on usage past this free allotment. Pricing is based on total number of invocations, and compute time. Compute time is variable based on the amount of memory and CPU provisioned for a function. Usage limits are also enforced through daily and 100s quotas. For more information, see Cloud Functions Pricing.



    更新

    就我而言,上述解决方案有效。希望这篇文章对其他人有所帮助!

    最佳答案

    由于网络问题,我收到此错误。并在连接时解决

    关于javascript - 错误 : getaddrinfo EAI_AGAIN api. spotify.com:443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53112049/

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