Search code examples
node.jsnpmgrpcyarnpkg

How to fix the npm install node-pre-gyp ERR error


When I run yarn install I get the following error, I've deleted the node_modules and yarn.lock files and tried again but no luck, seems to be something with gRPC looking at the error message.

Not sure what to do... Any suggestions?

> grpc@1.10.1 install /Users/mynamegoeshere/Desktop/Projects2/mydemoapp2/mydemoapp/node_modules/@firebase/firestore/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-darwin-x64-unknown.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.16.3 (node-v64 ABI, unknown) (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.16.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file 
  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: ./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
npm ERR! Failed at the grpc@1.10.1 install script.

Solution

  • That version of the grpc library is old and is not compatible with that version of Node. You should either use a newer version of grpc or an older version of Node. The newest version of grpc is currently 1.24.2.