Kaz*_*uki 2 node.js google-cloud-platform google-cloud-functions
我对这个 Google Cloud Platform 的解决方案感兴趣,但我遇到了一个问题。 https://cloud.google.com/solutions/processing-user- generated-content-using-video-intelligence
我尝试在此 Github 存储库上提出问题,但没有问题选项卡。所以,我在这里发布我的问题。 https://github.com/GoogleCloudPlatform/cloud-functions-intelligentcontent-nodejs
我在 GCP 的 Cloud Shell 上完成了所有操作。
我按照教程https://cloud.google.com/solutions/processing-user- generated-content-using-video-intelligence 进行操作,一切都很完美,直到我部署了 GCStoPubsub 函数。
部署GCStoPubsub函数
首先,我尝试了这个。
gcloud functions deploy GCStoPubsub --stage-bucket gs://staging-kazu --trigger-topic upload_notification --entry-point GCStoPubsub
Run Code Online (Sandbox Code Playgroud)
然后,我收到此错误消息。
ERROR: (gcloud.functions.deploy) Missing required argument [runtime]: Flag `--runtime` is requir
ed for new functions.
Run Code Online (Sandbox Code Playgroud)
所以,我添加--runtime nodejs10并再次尝试。
gcloud functions deploy GCStoPubsub --stage-bucket gs://staging-kazu --trigger-topic upload_notification --entry-point GCStoPubsub --runtime nodejs10
Run Code Online (Sandbox Code Playgroud)
然后,我收到了更大的错误消息。
Deploying function (may take a while - up to 2 minutes)...failed.
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: ...ence/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 5.3.0-1030-gcp
node-pre-gyp ERR! command "/usr/bin/node" "/workspace/node_modules/@google-cloud/video-intelligence/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=s
tatic_library"
node-pre-gyp ERR! cwd /workspace/node_modules/@google-cloud/video-intelligence/node_modules/grpc
node-pre-gyp ERR! node -v v10.20.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
In file included from ../deps/grpc/src/core/lib/channel/channel_stack.c:19:0:
../deps/grpc/src/core/lib/channel/channel_stack.h:38:10: fatal error: grpc/grpc.h: No such file or directory
#include <grpc/grpc.h>
^~~~~~~~~~~~~
compilation terminated.
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.3.0-1030-gcp
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/workspace/node_modules/@goo
gle-cloud/video-intelligence/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/workspace/node_modules/@google-cloud/v
ideo-intelligence/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc"
gyp ERR! cwd /workspace/node_modules/@google-cloud/video-intelligence/node_modules/grpc
gyp ERR! node -v v10.20.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN The package ava is included as both a dev and production dependency.
npm WARN The package sinon is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.7.3 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.7.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /builder/home/.npm/_logs/2020-08-03T08_15_41_930Z-debug.log; Error ID: 49341d49
Run Code Online (Sandbox Code Playgroud)
请问您能给我什么建议吗?
小智 5
这可能很难。我无法遵循整个过程,但我希望它会有所帮助。
npm install云功能在部署期间运行。因此,在克隆 github 存储库后,我在本地(准确地说是 GCP 云 shell)使用此命令复制了此错误。据我了解,这与依赖性有关"@google-cloud/video-intelligence": "^0.3.0"。
当我查看视频智能 API 文档并尝试使用没有版本的 npm 安装它时,它被添加到版本为 的项目中"^3.0.1"。我不确定 github 是否包含拼写错误或什么,但是当我将此依赖项更正为:
"@google-cloud/video-intelligence": "^3.0.1"
Run Code Online (Sandbox Code Playgroud)
npm install命令运行没有任何问题。
这应该有助于解决这个特定的错误,但是我不知道它会对整个过程产生什么影响。无论如何我希望它会有所帮助!祝你好运!
| 归档时间: |
|
| 查看次数: |
11133 次 |
| 最近记录: |