grpc: Installing @google-cloud & grpc fails via npm

What version of gRPC and what language are you using?

Trying to install google-cloud/pubsub, and it’s dependent on gRPC. Using NPM 4.2 and Node.js 7.8

What operating system (Linux, Windows, …) and version?

Ubuntu 16.04, running in Docker

What runtime / compiler are you using (e.g. python version or version of gcc)

NPM

What did you do?

Simply running NPM install on @google-cloud/pubsub or grpc directly results in this error:

> grpc@1.7.2 install /root/folder/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v51-linux-x64-glibc.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.7.2 and node@7.8.0 (node-v51 ABI, glibc) (falling back to source compile with node-gyp) 
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack     at /usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:114:15)
gyp ERR! System Linux 4.4.0-101-generic
gyp ERR! command "/usr/local/nvm/versions/node/v7.8.0/bin/node" "/usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/root/folder/node_modules/grpc/src/node/extension_binary/node-v51-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/root/folder/node_modules/grpc/src/node/extension_binary/node-v51-linux-x64-glibc"
gyp ERR! cwd /root/folder/node_modules/grpc
gyp ERR! node -v v7.8.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/nvm/versions/node/v7.8.0/bin/node /usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/root/folder/node_modules/grpc/src/node/extension_binary/node-v51-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/root/folder/node_modules/grpc/src/node/extension_binary/node-v51-linux-x64-glibc' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/root/folder/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.0-101-generic
node-pre-gyp ERR! command "/usr/local/nvm/versions/node/v7.8.0/bin/node" "/root/folder/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /root/folder/node_modules/grpc
node-pre-gyp ERR! node -v v7.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/nvm/versions/node/v7.8.0/bin/node /usr/local/nvm/versions/node/v7.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/root/folder/node_modules/grpc/src/node/extension_binary/node-v51-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/root/folder/node_modules/grpc/src/node/extension_binary/node-v51-linux-x64-glibc' (1)

npm ERR! argv "/usr/local/nvm/versions/node/v7.8.0/bin/node" "/usr/local/nvm/versions/node/v7.8.0/bin/npm" "i"
npm ERR! node v7.8.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! grpc@1.7.2 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.2 install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/.npm/_logs/2017-12-07T08_52_12_285Z-debug.log
Exited with code 1

Anything else we should know about your project / environment?

Seeing the error in CircleCI when trying to deploy to Docker, but works fine locally in similar enviroment

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 7
  • Comments: 27 (3 by maintainers)

Most upvoted comments

As a workaround, forcing the build to use grpc 1.6.6 seems to work for now.

// in package.json
"dependencies": {
  ...
  "grpc": "1.6.6",
  ...
}

Hi, I have the same issue. @kulinsj @kulinsj. but I switch to the china mirror (https://registry.npm.taobao.org) work for me. $ npm install -g cnpm --registry=https://registry.npm.taobao.org

PS D:\Git\www> cnpm install grpc √ Installed 1 packages √ Linked 36 latest versions node-pre-gyp http GET https://npm.taobao.org/mirrors/grpc/v1.8.0/node-v57-win32-x64-unknown.tar.gz node-pre-gyp http 200 https://npm.taobao.org/mirrors/grpc/v1.8.0/node-v57-win32-x64-unknown.tar.gz [grpc] Success: "D:\Git\www\node_modules\_grpc@1.8.0@grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node" is installed via remote √ Run 1 scripts Recently updated (since 2017-12-14): 1 packages (detail see file D:\Git\www\node_modules\.recently_updates.txt) √ All packages installed (37 packages installed from npm registry, used 4s, speed 20.27kB/s, json 37(71.35kB), tarball 0B)

To add on, it’s worth noting that setting the logging level to verbose shows that the error does not appear to be network related.

> grpc@1.8.0 install /usr/src/app/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/bin/node',
node-pre-gyp verb cli   '/usr/src/app/node_modules/grpc/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli   'install',
node-pre-gyp verb cli   '--fallback-to-build',
node-pre-gyp verb cli   '--library=static_library' ]
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@6.12.2 | linux | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/usr/src/app/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64-glibc/grpc_node.node" (not found)  
node-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-linux-x64-glibc.tar.gz
node-pre-gyp http 200 https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-linux-x64-glibc.tar.gz
node-pre-gyp info install unpacking grpc_node.node
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v48-linux-x64-glibc.tar.gz 

There’s clearly a 200 response code from the download attempt and it tries to unpack the download which is what appears to crash.

For comparison, some logs from an earlier build that were still succeeding

node-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.6.6/node-v48-linux-x64.tar.gz
node-pre-gyp http 200 https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.6.6/node-v48-linux-x64.tar.gz
node-pre-gyp info install unpacking grpc_node.node
node-pre-gyp info tarball done parsing tarball
[grpc] Success: "/usr/src/app/node_modules/grpc/src/node/extension_binary/node-v48-linux-x64/grpc_node.node" is installed via remote