你知道如何解决Node.js heroku部署失败时错误消息说grpc命令失败了吗?我怀疑它是在heroku结束时的grpc版本或节点版本问题。
我已经运行了这个命令: heroku buildpacks:设置https://github.com/heroku/heroku-buildpack-nodejs#v123 -a myApp
[4/4] Building fresh packages...
error /tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc: Command failed.
Exit code: 1
Command: ./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library
Arguments:
Directory: /tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc
Output:
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
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.2.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@10.2.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
make: Entering directory '/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/build'
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
make: Entering directory '/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/build'
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
grpc.target.mk:388: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o' failed
make: Leaving directory '/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/build'
Failed to execute '/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/bin/node /tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc' (1)
rm: cannot remove './Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw': No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.4.0-1019-aws
gyp ERR! command "/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/bin/node" "/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc"
gyp ERR! cwd /tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/bin/node /tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Linux 4.4.0-1019-aws
node-pre-gyp ERR! command "/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/.heroku/node/bin/node" "/tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /tmp/build_b9178ea7e8a83dfc95c327fb45eaba92/node_modules/grpc
node-pre-gyp ERR! node -v v10.2.1
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
答案 0 :(得分:0)
gRPC库的1.10版本不适用于节点10.从那时起,版本1.11和1.12已经发布,并且这两个版本都支持节点10.