LoginSignup
1

More than 5 years have passed since last update.

Node.js on Herokuの環境でgrpc@1.10.1 install error

Last updated at Posted at 2018-05-30

Herokuで動かしているNode.jsのサーバにdeployした際、謎のエラーでBuild Failedした件。

Installing node modules (package.json)

> grpc@1.10.1 install /tmp/build_6361fb4d8a2fa1b8703d71219349dfb2/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-linux-x64-glibc.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.3.0 (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.3.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file

grpc@1.10.1がインストールできていないっぽい。

Node.jsのバージョン指定をダウングレード

package.jsonを書き換えます。

Before

package.json
"engines": {
    "node": ">=6.0.0",
    "npm": ">= 3.0.0"
  }

After

package.json
"engines": {
    "node": "8.9.4",
    "npm": ">= 3.0.0"
  }

"node": ">=6.0.0"にしていたせいで、node --versionが最新のv10.0.0になっていました。Node v10とgrpc@1.10.1の相性が悪いみたい。
参考: https://github.com/firebase/firebase-js-sdk/issues/780#issuecomment-390650868

v8.xだと問題ないらしいので試してみたところ、正常にdeployできました。:tada:
ここ数日起きている現象のようなので早めに解消されると思いますが、取り急ぎ。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1