grpc-node: gRPC sporadically doesn't build properly under node 11.

Problem description

A clear and concise description of what the problem is. After upgrading to node 11.0.0 npm install fails due to @google-cloud/language dependency which has a dependency to google-gax which has a dependency to grpc@1.15.1

 node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.15.1/node-v67-darwin-x64-unknown.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for grpc@1.15.1 and node@11.0.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Pre-built binaries not installable for grpc@1.15.1 and node@11.0.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error Connection closed while downloading tarball file 

grpc/src/node/extension_binary/node-v67-darwin-x64-unknown --napi_version=3 --node_abi_napi=napi' (1)
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.oexec install script
../deps/grpc/src/core/lib/backoff/backoff.cc:19:10: fatal error: 'grpc/support/port_platform.h' file not found
#include <grpc/support/port_platform.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.░⸩ ⠸ install: info lifecycle grpc@1.15.1~install: Failed to exec install script
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o] Error 1

Reproduction steps

Give very precise steps you’ve discovered to reproduce your problem. If possible and applicable, provide us with a repository we can clone that contains a reproduction case. Also if possible and applicable, please include a Dockerfile that exhibits the problem if it’s specific to a certain environment. Bug reports with no reproduction steps will be closed. Npm install -Node version 11.0.0 -Add reference to @google-cloud/language

Environment

  • OS name, version and architecture: [e.g. Linux Ubuntu 18.04 amd64] Mac OS
  • Node version [e.g. 8.10.0] 11.0.0
  • Node installation method [e.g. nvm]
  • If applicable, compiler version [e.g. clang 3.8.0-2ubuntu4]
  • Package name and version [e.g. gRPC@1.12.0] 1.15.1

Additional context

Add any other context about the problem here. If possible, attach full logs. Do not try to omit anything for brevity, but instead include absolutely everything. Please try and set your operating system’s locale to English, so that logs contain error messages in the English language.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 13
  • Comments: 45 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Found the rootcause. The culprit is mapbox/node-pre-gyp#426. A workaround for now with node 11 is to always add the --build-from-source option on npm install, which won’t attempt an http download, and won’t trigger the problem.

Running Node v10.13.0 today and GRPC fails to install using npm i -S grpc Error:

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.9.1/node-v64-linux-x64-musl.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.9.1 and node@10.13.0 (node-v64 ABI, musl) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.9.1/node-v64-linux-x64-musl.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.9.1 and node@10.13.0 (node-v64 ABI, musl) (falling back to source compile with node-gyp) 
make: Entering directory '/var/www/app/current/node_modules/grpc/build'
make: Entering directory '/var/www/app/current/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/surface/init.o
rm: can't remove './Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw': No such file or directory
make: *** [grpc.target.mk:394: Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
make: Leaving directory '/var/www/app/current/node_modules/grpc/build'
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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.14.48-coreos-r2
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=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl"
gyp ERR! cwd /var/www/app/current/node_modules/grpc
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/var/www/app/current/node_modules/grpc/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:962:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Linux 4.14.48-coreos-r2
node-pre-gyp ERR! command "/usr/bin/node" "/var/www/app/current/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /var/www/app/current/node_modules/grpc
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl' (1)
Assembler messages:
Error: can't open /var/www/app/current/node_modules/grpc/ccDekbog.s for reading: No such file or directory
make: *** [grpc.target.mk:394: Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o] Error 1
make: Leaving directory '/var/www/app/current/node_modules/grpc/build'
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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.14.48-coreos-r2
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=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/var/www/app/current/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl"
gyp ERR! cwd /var/www/app/current/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.9.1 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.9.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Seems like this file: https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.9.1/node-v64-linux-x64-musl.tar.gz is not Publicly openned

@nicolasnoble what about yarn?

The only solution I found was to downgrade Node to the current lts : 10.13.0

Steps:

  1. sudo npm cache clean -f
  2. sudo npm install -g n
  3. sudo n 10.13.0
  4. npm install firebase

I have to downgrade to v10.13.0 of Node, delete my node_modules folder and do npm install… Works for me

@mantielero your issue is that you can’t compile from source because of https://github.com/grpc/grpc/issues/15576 since your compiler isn’t agreeing with the code we publish. Once we can have node-pre-gyp’s node 11 support, we’ll be able to publish node 11 prebuilt binaries and you won’t have to compile from source.

@Tsangares that may be a tangential issue, where we don’t properly support your compiler. It’s in fact the same as https://github.com/grpc/grpc/issues/15576 - is your compiler gcc 8? If yes, please follow along on the other issue.

@Djiit electron-builder is a different issue altogether. Please read the relevant section of our readme about using grpc with electron: https://github.com/grpc/grpc-node/tree/master/packages/grpc-native-core#about-electron

Did any of the last reports see my update and workaround?

Works fine with Node 10.12.0