【问题标题】:Pre-built binaries not found for grpc@1.10.1 and node@10.9.0未找到 grpc@1.10.1 和 node@10.9.0 的预构建二进制文件
【发布时间】:2019-02-09 08:56:38
【问题描述】:

当我尝试在我的项目中安装 node_modules 时收到大量错误消息。我之前已经成功安装了它,但我不确定我做错了什么导致现在生成所有这些错误消息。

任何帮助破译他们的意思都会很棒。就在此之前,我做了以下 grpc 的安装,它安装了 v1.14.1:

$ npm install -g grpc@latest

grpc@1.14.1 install /usr/local/lib/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 
[grpc] Success: "/usr/local/lib/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" is installed via remote
+ grpc@1.14.1
added 85 packages from 48 contributors in 6.344s

所以很好奇为什么 node 在以下消息中尝试使用 v1.10.1:

$ npm i

> fsevents@1.2.4 install /path/to/app/node_modules/fsevents
> node install

[fsevents] Success: "/path/to/app/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> grpc@1.10.1 install /path/to/app/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.9.0 (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.9.0 (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
sed: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.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
gyp ERR! stack     at ChildProcess.onExit (/usr/local/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:239:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.9.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /path/to/app/node_modules/@firebase/firestore/node_modules/grpc
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.9.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/path/to/app/node_modules/@firebase/firestore/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:961:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/10.9.0/bin/node" "/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /path/to/app/node_modules/@firebase/firestore/node_modules/grpc
node-pre-gyp ERR! node -v v10.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/Cellar/node/10.9.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.oexec install script
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.oinstall script
error: error reading '../deps/grpc/src/core/lib/channel/channel_args.cc'
1 error generated.
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/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:239:12)
gyp ERR! System Darwin 17.7.0l: info lifecycle grpc@1.10.1~install: Failed to exec install script
gyp ERR! command "/usr/local/Cellar/node/10.9.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/path/to/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /path/to/app/node_modules/@firebase/firestore/node_modules/grpc
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.10.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.10.1 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/myfolder/.npm/_logs/2018-09-03T16_54_49_177Z-debug.log

【问题讨论】:

  • 您的项目是否在 package.json 中有“node-sass”?我有并且有同样的错误。试试npm i node-sass 看看是不是这个原因。
  • 不,在 package.json 或 config.xml 中没有提到 sass。我猜它只是随节点一起提供的。

标签: node.js firebase npm


【解决方案1】:

将您的节点降级到 10.0.0,然后使用此确切版本添加“grpc”的依赖项:“~1.22.2”。然后,以管理员身份使用命令提示符执行 npm i。

【讨论】:

  • 我遇到了 Angular 项目 @5.0.5 和 "firebase": "^4.12.0", "firebaseui": "^2.7.0" 的问题。
【解决方案2】:

我安装了 windows-build-tools 并更新了 firebase。成功了

【讨论】:

    【解决方案3】:

    如果您使用窗户。以管理员身份尝试启动命令。

    【讨论】:

      【解决方案4】:

      我遇到了与 grpc@1.23.1 相同的问题,我输入了 package.json "grpc": "~1.22.2" 并解决了问题。 似乎编译 grpc@1.21.0 和 @1.23.1 存在问题,但在 @1.22 上它工作正常。 没有

      【讨论】:

        【解决方案5】:

        经过多次努力,我遇到了同样的问题。这是因为 npm 版本与 gprc 版本不兼容。 所以我们需要更新 npm。

        1 - npm update
        2 - npm install 
        

        这解决了我的问题。 谢谢

        【讨论】:

        【解决方案6】:

        我遇到了类似的问题。尝试了所有的东西,但没有缓解:(

        ~/Documents/dev/node/fb: npm install -save firebase

        grpc@1.20.3 安装 /Users/hbhagwat001/Documents/dev/node/fb/node_modules/grpc node-pre-gyp install --fallback-to-build --library=static_library

        node-pre-gyp WARN 使用 needle 进行 node-pre-gyp https 下载 node-pre-gyp 警告 grpc@1.20.3 和 node@12.6.0(node-v72 ABI,未知)无法安装预构建的二进制文件(回退到使用 node-gyp 进行源编译) node-pre-gyp WARN 在证书链中命中错误自签名证书 吉普错误!配置错误 吉普错误!堆栈错误:命令失败:/anaconda3/bin/python -c import sys;打印 "%s.%s.%s" % sys.version_info[:3]; 吉普错误!堆栈文件“”,第 1 行 吉普错误!堆栈导入系统;打印 "%s.%s.%s" % sys.version_info[:3];

        【讨论】:

        • 添加问题的答案,而不是问题本身
        【解决方案7】:

        花了一段时间才找到,但对我有用的解决方案是:

        1. 删除 node_modules/grpc 文件夹
        2. 删除项目根目录下的package-lock.json文件
        3. npm 重建 node-sass

        ionic serve 和 build 命令现在适用于 ios。

        编辑(2018-09-07):

        虽然上述步骤暂时奏效,但grpc 1.10.1问题后来又出现了。经过更多调查并感谢@murgatroid99 的提示,我发现问题是由firebase 插件中的旧版本firestore 引起的,该插件在其package.json 中引用了grpc v1.10.1。

        在我将 firebase 更新到最新版本后:

        npm i firebase@latest
        

        它使用 v1.13.1 报告并且问题消失了。

        希望对遇到同样问题的人有所帮助。

        【讨论】:

        • npm rebuild node-sass 是什么?我们不是必须先做npm i 吗?
        • 我遇到了同样的错误,卸载了firebase并安装了最新版本,解决了这个问题。
        • 这里也一样!卸载并重新安装最新的 firebase 解决了这个问题。
        • 太棒了。谢谢楼主
        • 嗨!这在 12-2020 之前仍然有用。非常感谢。
        【解决方案8】:

        这里的问题是 gRPC 1.10 有点旧,不支持 Node 10。您可以通过使用新版本的 gRPC 或旧版本的 Node 来解决这个问题。

        问题中的错误信息表示将gRPC安装为@firebase/firestore的依赖项时发生故障。您可能需要升级对该包的依赖以获得更新版本的 gRPC。

        【讨论】:

        • 是的,它确实很旧,我已经安装了 v1.14.1,而且在我能看到的任何地方都提到了它,而我在任何地方都找不到任何提到 1.10.1 的地方。所以我仍然想知道 npm 从哪里获得 1.10.1 版本。任何获得 v1.10.1 的想法都会很棒。
        • 我在回答中添加了一些关于该版本来自何处的信息
        • 我尝试使用 npm i @firebase@latest 更新它,但我收到消息“无效的包名称“@firebase”:名称只能包含 URL 友好字符”。更新此软件包的正确方法是什么?
        • 我也注意到了一件奇怪的事情。我不在我的应用程序中使用 firestore,所以我不知道为什么它被包含在内,但是当我尝试更新/删除其他包时,例如npm uninstall cordova-plugin-fcm,node_modules/@firestore 下的firestore 文件夹短暂出现,然后消失。知道为什么会发生这种情况吗?
        • 包名不是@firebase,而是@firebase/firestore
        【解决方案9】:

        您的节点版本是多少?您可以通过“node -v”检查它,我的是 v10.9.0 并且我遇到了这个错误,但是当我从这个站点“https://nodejs.org/en/”下载降级到 v8.11.4 并进行 npm 更新时 - 它可以工作。

        【讨论】:

        • 它是 node-sass@4.9.3,但奇怪的是消息似乎使用 grpc@1.10.1,即使我安装了 v1.14.1。我不知道它从哪里得到 v1.10.1。另外,我尝试在浏览器中访问storage.googleapis.com/grpc-precompiled-binaries/node/grpc/…,它给出了拒绝访问的消息,那是谷歌没有正确设置他们的权限吗?
        • 你救了我的命
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2022-12-19
        • 2020-08-02
        • 2023-03-31
        • 1970-01-01
        • 2016-06-24
        • 2010-12-07
        • 1970-01-01
        相关资源
        最近更新 更多