Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 错误:(gcloud.functions.deploy)操作错误:代码=3,消息=Build失败_Node.js_Google Cloud Platform_Google Cloud Functions - Fatal编程技术网

Node.js 错误:(gcloud.functions.deploy)操作错误:代码=3,消息=Build失败

Node.js 错误:(gcloud.functions.deploy)操作错误:代码=3,消息=Build失败,node.js,google-cloud-platform,google-cloud-functions,Node.js,Google Cloud Platform,Google Cloud Functions,我对这个谷歌云平台的解决方案很感兴趣,但我面临一个问题。 我试图在Github回购协议上提出问题,但没有问题标签。所以,我把我的问题贴在这里。 我在GCP的云壳上做了一切 我遵循教程,在部署gcstopusub函数之前,一切都很完美 部署gcstopusub函数 首先,我试过这个 gcloud functions deploy GCStoPubsub --stage-bucket gs://staging-kazu --trigger-topic upload_notification -

我对这个谷歌云平台的解决方案很感兴趣,但我面临一个问题。

我试图在Github回购协议上提出问题,但没有问题标签。所以,我把我的问题贴在这里。

我在GCP的云壳上做了一切

我遵循教程,在部署gcstopusub函数之前,一切都很完美

部署gcstopusub函数

首先,我试过这个

gcloud functions deploy GCStoPubsub --stage-bucket gs://staging-kazu --trigger-topic upload_notification --entry-point GCStoPubsub
然后,我收到了这个错误消息

ERROR: (gcloud.functions.deploy) Missing required argument [runtime]: Flag `--runtime` is requir
ed for new functions.
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
因此,我添加了
——运行时节点js10
,然后重试

gcloud functions deploy GCStoPubsub --stage-bucket gs://staging-kazu --trigger-topic upload_notification --entry-point GCStoPubsub --runtime nodejs10
然后,我得到了这个更大的错误信息

ERROR: (gcloud.functions.deploy) Missing required argument [runtime]: Flag `--runtime` is requir
ed for new functions.
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
部署功能(可能需要一段时间-最多2分钟)…失败。
错误:(gcloud.functions.deploy)操作错误:code=3,message=Build failed:…ence/node_modules/grpc/node_modules/node pre-gyp/lib/util/compile.js:83:29)
节点前gyp错误!ChildProcess.emit上的堆栈(events.js:198:13)
节点前gyp错误!maybeClose的堆栈(内部/子进程js:982:16)
节点前gyp错误!在Process.ChildProcess.\u handle.onexit(internal/child\u Process.js:259:5)处堆栈
节点前gyp错误!Linux系统5.3.0-1030-gcp
节点前gyp错误!命令“/usr/bin/node”“/workspace/node_modules/@google cloud/video intelligence/node_modules/grpc/node_modules/.bin/node pre-gyp”“install”“--回退到构建”“--library=s
"图书馆"
节点前gyp错误!cwd/workspace/node_modules/@google cloud/video intelligence/node_modules/grpc
节点前gyp错误!节点-v10.20.1
节点前gyp错误!gyp前节点-v v0.6.39
节点前gyp错误!不好
在../deps/grpc/src/core/lib/channel/channel_stack.c:19:0中包含的文件中:
../deps/grpc/src/core/lib/channel/channel_stack.h:38:10:致命错误:grpc/grpc.h:没有这样的文件或目录
#包括
^~~~~~~~~~~~~
编译终止。
make:**[Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o]错误1
哎呀!构建错误
哎呀!堆栈错误:`make`失败,退出代码:2
哎呀!堆栈位于ChildProcess.onExit(/usr/lib/node_modules/npm/node_modules/node gyp/lib/build.js:191:23)
哎呀!ChildProcess.emit上的堆栈(events.js:198:13)
哎呀!在Process.ChildProcess.\u handle.onexit(internal/child\u Process.js:248:12)处堆栈
哎呀!Linux系统5.3.0-1030-gcp
哎呀!命令“/usr/bin/node”“/usr/lib/node_modules/npm/node_modules/node gyp/bin/node gyp.js”“build”“--回退到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“
哎呀!cwd/workspace/node_modules/@google cloud/video intelligence/node_modules/grpc
哎呀!节点-v10.20.1
哎呀!节点gyp-v5.1.0
哎呀!不好
npm警告包ava同时作为开发和生产依赖项包含。
npm警告:软件包sinon同时作为开发和生产依赖项包含。
npm警告可选跳过可选依赖项:fsevents@1.2.13(节点\单元模块/fsevents):
npm WARN notsup跳过可选依赖项:不支持的平台fsevents@1.2.13:通缉{“os”:“darwin”,“arch”:“any”}(当前:{“os”:“linux”,“arch”:“x64”})
npm错误!代码失效循环
npm错误!错误1
npm错误!grpc@1.7.3install:`node pre-gyp install--fallback to build--library=static\u library`
npm错误!退出状态1
npm错误!
npm错误!失败grpc@1.7.3安装脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm错误!此运行的完整日志可在以下位置找到:
npm错误/builder/home/.npm/_logs/2020-08-03T08_15_41_930Z-debug.log;错误ID:49341d49

你能给我一些建议吗?

这可能很难。我不能按照整个程序进行,但我希望这会有所帮助

部署期间,CLOLD功能正在运行
npm安装
。因此,在克隆github repo之后,我在本地(精确地说是GCP cloud shell)使用这个命令复制了这个错误。根据我的理解,这与依赖关系有关
“@googlecloud/video intelligence”:“^0.3.0”

当我查看并尝试使用npm安装它时,它被添加到了版本为“^3.0.1””的项目中。我不确定github是否包含打字错误或其他内容,但是当我将此依赖项更正为:

"@google-cloud/video-intelligence": "^3.0.1"
npm install
命令运行时没有任何问题


这应该有助于解决这个特殊的错误,但我不知道它会对整个过程产生什么影响。无论如何,我希望这会有帮助!祝你好运

非常感谢你的回答。它是完美的。你是我的英雄!