gpt4 book ai didi

google-app-engine - 谷歌云没有正确安装包

转载 作者:太空宇宙 更新时间:2023-11-03 15:34:53 24 4
gpt4 key购买 nike

我正在尝试将我的应用程序部署到 Google Clouds App Engine。它作为本地实例完美运行,但一旦我将其上传到 gcloud,它就会按预期停止运行。

我正在为 discord 创建一个机器人。通过它,我可以访问 discord 和 youtubes API。连接到这些似乎有效,因为机器人在发布后上线。但是,似乎音乐播放功能在 gcloud 上运行时停止工作。所有其他功能都按预期工作。这就是为什么我怀疑某些包裹出了问题。可能与音乐或声音有关。

问题:有没有办法通过云端Console或cmd来验证我的节点包是否已经正确安装?或者更好的是,重新安装它们。

我看过Deploy and run App Engine .

我使用 cmd 工具发布并运行:gcloud app deploy

应用程序.yaml:

runtime: nodejs
env: flex
manual_scaling:
instances: 1

package.json:

{
"name": "yup",
"version": "1.0.5",
"description": "bot",
"main": "app.js",
"private": true,
"engines": {
"node": ">=8.11.3"
},
"scripts": {
"start": "node app.js",
"deploy": "gcloud app deploy",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Joel",
"license": "ISC",
"dependencies": {
"@types/request": "^2.48.1",
"discord.js": "^11.4.2",
"express": "^4.16.4",
"ffmpeg-binaries": "^4.0.0",
"fs": "0.0.1-security",
"get-youtube-id": "^1.0.1",
"opusscript": "0.0.6",
"request": "^2.88.0",
"youtube-info": "^1.3.2",
"ytdl-core": "^0.29.1",
"ytdl-getinfo": "^1.1.0"
},
"devDependencies": {
"typescript": "^3.3.3333"
}
}

经过进一步检查,我可以在安装日志中看到这一点:

Step #1: npm WARN discord.js@11.4.2 requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself.
Step #1: npm WARN discord.js@11.4.2 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
Step #1: npm WARN discord.js@11.4.2 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
Step #1: npm WARN discord.js@11.4.2 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
Step #1: npm WARN discord.js@11.4.2 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
Step #1: npm WARN discord.js@11.4.2 requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself.

最佳答案

要检查 App Engine 应用的依赖项是否已从 Google Cloud Console 正确安装:

  1. 在 Stackdriver Logging > 日志(日志查看器)页面上检查日志。
  2. > Filter logs :
    • 按资源,从下拉菜单中选择:云构建,
    • 通过文本搜索,搜索package.json或者指定包,例如 ffmpeg-binaries,
    • 按日期

也可以从 Cloud Shell 环境获取 App Engine 构建日志:

  1. 获取构建的 ID:$ cloud builds list
  2. > List complete build log : $ gcloud 构建日志 [build-ID]

在日志中您应该看到:successfully installed [package name-version]

要重新安装依赖项,您需要部署新版本的应用。如果已经缓存的包出现问题,请尝试 --no-cache 标志,mentioned in the documentation .


关于google-app-engine - 谷歌云没有正确安装包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55087636/

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