【问题标题】:Firebase installation error with "Pre-built binaries not found for grpc@1.19.0 and node@12.1.0"Firebase 安装错误,“未找到 grpc@1.19.0 和 node@12.1.0 的预构建二进制文件”
【发布时间】:2019-05-02 01:37:11
【问题描述】:

我正在尝试在我的 MacBook 上安装 firebase,但出现以下错误。

$ npm install -g firebase

> grpc@1.19.0 install /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.19.0/node-v72-darwin-x64-unknown.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for grpc@1.19.0 and node@12.1.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack 
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:304:12)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:1000:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node" "/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc
gyp ERR! node -v v12.1.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 '/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1000:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
node-pre-gyp ERR! System Darwin 18.5.0
node-pre-gyp ERR! command "/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node" "/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc
node-pre-gyp ERR! node -v v12.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok 
Failed to execute '/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.19.0 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.19.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/satoshi/.npm/_logs/2019-04-30T20_15_40_148Z-debug.log

我有 npm (6.9.0) 和 node (12.1.0)。它看起来像是一种版本不匹配,但我无法找到解决此问题的方法。

【问题讨论】:

    标签: node.js firebase


    【解决方案1】:

    这里的问题是 grpc 1.19.0 与 Node 12 不兼容。grpc 1.20.2 版本与 Node 12 兼容,因此如果 Firebase 更新它们的依赖关系,也将解决问题。

    【讨论】:

      【解决方案2】:

      这对我有用:

      install nvm from  https://github.com/nvm-sh/nvm
      switch to node version : v10.15.3
      
      

      【讨论】:

      • 你好!请熟悉本网站上的格式化代码示例:stackoverflow.com/editing-help
      • 我很感激,但它并没有解决问题。我仍然看到相同的错误消息。
      • 切换到 v10.15.3 解决了这个问题。谢谢!
      • firebase 的grpc@1.22.2 范围内遇到了这个问题,发现直到grpc@1.24.3 才支持node 14 LTS,同样,这现在意味着锁定任何节点版本到 12,而不是自动更新到 14(下一个 LTS)。把这个留在这里给最近更新后发现它的人 firebase
      猜你喜欢
      • 2019-02-09
      • 1970-01-01
      • 2022-12-19
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-26
      相关资源
      最近更新 更多