gpt4 book ai didi

node.js - 由于 "grpc",无法推送到 Heroku

转载 作者:太空宇宙 更新时间:2023-11-04 02:52:09 26 4
gpt4 key购买 nike

我正在尝试将 NodeJS Web 应用程序的更改推送到 heroku;但是,我在构建阶段遇到以下错误消息。我知道问题在于“grpc”(请参阅​​错误消息),我怀疑它是 firebase 的依赖项;但是,我不知道如何解决这个问题。 Here是我在 SO 上发现的一个非常相似的问题,但该线程上没有明确的解决方案。

remote:        [4/4] Building fresh packages...
remote: error /tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc: Command failed.
remote: Exit code: 1
remote: Command: ./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library
remote: Arguments:
remote: Directory: /tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc
remote: Output:
remote: node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-linux-x64-glibc.tar.gz
remote: node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.4.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
remote: node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@10.4.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
remote: node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
remote: make: Entering directory '/tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc/build'
remote: make: Entering directory '/tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc/build'
remote: CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
remote: CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
remote: CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
remote: sed: can't read ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
remote: rm: cannot remove './Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw': No such file or directory
remote: grpc.target.mk:394: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o' failed
remote: make: Leaving directory '/tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc/build'
remote: make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
remote: gyp ERR! build error
remote: gyp ERR! stack Error: `make` failed with exit code: 2
remote: gyp ERR! stack at ChildProcess.onExit (/tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/node-gyp/lib/build.js:262:23)
remote: gyp ERR! stack at ChildProcess.emit (events.js:182:13)
remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
remote: gyp ERR! System Linux 4.4.0-1019-aws
remote: gyp ERR! command "/tmp/build_5dcbc8b8883705e76971dd8574f59db8/.heroku/node/bin/node" "/tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc"
remote: gyp ERR! cwd /tmp/build_5dcbc8b8883705e76971dd8574f59db8/node_modules/grpc
remote: gyp ERR! node -v v10.4.0
remote: gyp ERR! node-gyp -v v3.7.0
remote: gyp ERR! not ok
remote: node-pre-gyp ERR! build error

已解决:

按照此 link 中的说明进行操作

OK :) firebase 4.6.2 firebase-admin 5.3.0 firebase-tools 3.7.0

KO :( firebase 4.7.0 + firebase-admin 5.4.0 + firebase-tools 3.8.0 +

At this stade you might think older versions could work with firestore. But, if you want to use firestore, it will claim the grpc node module, and if you yarn it, same error :/

最佳答案

这里的主要问题是您尝试安装的 gRPC 版本与您正在使用的 Node 版本不兼容。该错误表明您正在使用 Node 10 安装 gRPC@1.10.1;支持 Node 10 的第一个 gRPC 版本是 gRPC@1.11.1。因此,一般来说,解决此问题的方法是降级 Node 版本,或升级 gRPC 版本。

您的编辑似乎表明您可以通过降级您正在使用的 firebasefirebase-adminfirebase-tools 软件包的版本来解决此问题。这可能有效,因为您首先尝试的特定版本将 gRPC 依赖项固定到旧版本,而降级则为您提供了一个没有固定依赖项的版本。但是,每个软件包都有较新的版本,这些版本不固定 gRPC 依赖项,并且应该为您提供最新版本。

关于node.js - 由于 "grpc",无法推送到 Heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50795909/

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