【问题标题】:Meteor Application Fails to Find Fibers Binary; Yet NPM Built a Different OneMeteor 应用程序无法找到 Fibers 二进制文件;然而 NPM 构建了一个不同的
【发布时间】:2025-12-24 11:35:11
【问题描述】:

我正在将我的 Meteor 包部署到一个类似的 Ubuntu 18.04 系统作为开发。运行流星(启动应用程序)后,我收到以下错误:

## There is an issue with `node-fibers` ##
`/opt/docgen/bundle/programs/server/node_modules/fibers/bin/linux-x64-57-glibc/fibers.node` is missing.
Try running this to fix the issue: /usr/bin/node /opt/docgen/bundle/programs/server/node_modules/fibers/build
Error: Cannot find module '/opt/docgen/bundle/programs/server/node_modules/fibers/bin/linux-x64-57-glibc/fibers'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

然而,npm install(并调用 node build.js)为光纤构建了一个不同名称的二进制文件:

ubuntu@ip-xxx-xx-xxx-xx:/opt/docgen/bundle/programs/server/node_modules/fibers$ node build.js 
`linux-x64-72-glibc` exists; testing
Binary is fine; exiting

开发和生产中的节点版本:

ubuntu@ip-xxx-xx-xxx-3xxx-xx-xxx-xx:/opt/docgen/bundle/programs/server/node_modules/fibers$ node -v
v12.16.1

npm 版本:

ubuntu@ip-xxx-xx-xxx-xx:/opt/docgen/bundle/programs/server/node_modules/fibers$ npm -v
6.14.5

【问题讨论】:

  • 哪个 Meteor 版本?你是怎么安装的?
  • 也许我弄错了,但After running meteor ... 听起来你在生产服务器上安装了 Meteor。但是,您不应该安装 Meteor,而是 node 使用普通 NodeJs 运行您的应用程序包(通过 meteor build 命令构建)。
  • @Jankapunkt 不,我只是使用 Node 来运行它。但是我确实在生产服务器上安装了流星——只是不要使用它。我仍然不明白为什么生产服务器上从未使用过的新版本流星会产生任何影响。
  • @FredStark 为了澄清版本,我使用 Meteor 1.10.2;但是,只需使用提到的 Node 在生产中运行即可。我最近升级了 Meteor,现在我碰巧在构建(构建 tarball)时也遇到了这些错误:Unable to resolve some modules: "internal/bootstrap/loaders" in /home/ubuntu/environment/docgen/node_modules/esm/esm.js (web.browser.legacy) If you notice problems related to these missing modules, consider running: meteor npm install --save internal
  • 如果您使用流星的内置 npm 与来自源的 npm,它可以有所作为。

标签: gcc npm meteor fibers


【解决方案1】:

文件名二进制文件中的数字是 ABI(应用程序二进制接口)版本,又名 NODE_MODULE_VERSION this table

版本 72 是节点 12,因此它检查了当您使用节点 12 构建纤程时,您会获得 linux-x64-72-glibc 二进制文件。

我猜你正在使用 Meteor 1.6 - 1.8,它使用 Node 8

节点 8 使用 ABI 57,这正是它所要求的。因此,您希望使用 Node 8 构建纤程以获得正确的二进制文件。

请注意,对于正常的 Meteor 安装来说,这不是必需的,所以我会先重新安装 Meteor,然后再手动重建它的依赖项。

【讨论】:

  • 我正在使用 Meteor 1.10.2,所以奇怪的是它试图找到那个旧的节点模块版本。当我使用 Node 8 构建纤程,然后尝试运行我的应用程序时,我开始收到错误消息“Meteor 需要 Node v12.0.0 或更高版本”。所以我不知所措——有点卡在版本之间。
  • 那很奇怪……你试过重新安装 Meteor 吗?
  • 是的,我重新安装了流星,清除了以前的版本。然后我重新构建了 tarball 并将其传输到服务器,结果相同。
  • 这可能是我的流星构建在开发服务器上以某种方式收支平衡。当我构建我得到这个传递错误:Unable to resolve some modules: "internal/bootstrap/loaders" in /home/ubuntu/environment/docgen/node_modules/esm/esm.js (web.browser.legacy) 但是,运行安装包:meteor --save internal 不起作用。这是最近升级流星之后。
【解决方案2】:

这个问题似乎完全是由使用 Supervisor 启动应用程序引起的(主管不知道流星的某些方面吗?)。使用 systemd 启动应用程序不会产生如下错误。

Jun 17 05:06:55 ip-172-31-54-3 systemd[1]: Started AiLanthus Doc App.
Jun 17 05:06:56 ip-172-31-54-3 ailanthusdocs[31873]: Note: you are using a pure-JavaScript implementation of bcrypt.
Jun 17 05:06:56 ip-172-31-54-3 ailanthusdocs[31873]: While this implementation will work correctly, it is known to be
Jun 17 05:06:56 ip-172-31-54-3 ailanthusdocs[31873]: approximately three times slower than the native implementation.
Jun 17 05:06:56 ip-172-31-54-3 ailanthusdocs[31873]: In order to use the native implementation instead, run
Jun 17 05:06:56 ip-172-31-54-3 ailanthusdocs[31873]:   meteor npm install --save bcrypt
Jun 17 05:06:56 ip-172-31-54-3 ailanthusdocs[31873]: in the root directory of your application.
Jun 17 05:08:15 ip-172-31-54-3 ailanthusdocs[31873]: Before create temp file
Jun 17 05:08:15 ip-172-31-54-3 ailanthusdocs[31873]: Source Type: Filed Complaint
Jun 17 05:08:15 ip-172-31-54-3 ailanthusdocs[31873]: Matter ID: Sw9TS7tknvfuY7toB
Jun 17 05:08:17 ip-172-31-54-3 ailanthusdocs[31873]: It's saved!```

【讨论】:

  • @Jankapunkt 一个关于 Supervisor 的警示故事。
最近更新 更多