A clear and concise description of what the problem is.
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error /usr/src/app/server/node_modules/grpc: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --library=static_library
Arguments:
Directory: /usr/src/app/server/node_modules/grpc
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp info check checked for "/usr/src/app/server/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl/grpc_node.node" (not found)
node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v72-linux-x64-musl.tar.gz
node-pre-gyp http 200 https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v72-linux-x64-musl.tar.gz
node-pre-gyp info install unpacking node-v72-linux-x64-musl/grpc_node.node
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, musl) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error bad download
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/src/app/server/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:310:20)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
node-pre-gyp ERR! stack at onErrorNT (internal/child_process.js:469:16)
node-pre-gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:84:21)
node-pre-gyp ERR! System Linux 5.0.0-1034-gcp
node-pre-gyp ERR! command "/usr/bin/node" "/usr/src/app/server/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/src/app/server/node_modules/grpc
node-pre-gyp ERR! node -v v12.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
This only reproduces in Google Cloud Build.
Google Cloud Build.
Linux 5.0.0-1034-gcp
Docker with alpine:3.10
With that "Hit error bad download" line, this looks like the same bug that I reported as nodejs/node#33254, which turned out to actually be the bug tomas/needle#312, which has since been fixed. I am working on a grpc release that will pick up that new version of needle, which should fix that.
@murgatroid99 I also made a PR in node-pre-gyp https://github.com/mapbox/node-pre-gyp/pull/502 to upgrade it there, but not sure when / if it has a chance to get merged.
Fortunately, unbundling node-pre-gyp from grpc should be enough to pick up the new version of needle whether or not node-pre-gyp explicitly updates the dependency.
@murgatroid99 we did the request workaround for now, but will chnage it once it gets fixed. Should we track it in this issue?
I will update this issue when I publish the new version of grpc with the un-bundled dependency on node-pre-gyp.
grpc 1.24.3 is now out with that change.
I run into this issue today using latest node version, even with grpc 1.24.3. Using an older node version worked for me:
FROM node:15.0.1-alpine - bad
FROM node:10.12.0-alpine - good
Most helpful comment
I will update this issue when I publish the new version of
grpcwith the un-bundled dependency onnode-pre-gyp.