gccnpmmeteorfibers

Meteor Application Fails to Find Fibers Binary; Yet NPM Built a Different One


I am deploying my Meteor bundle to a similar Ubuntu 18.04 system as development. After running meteor (starting the application), I get the following error:

## 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)

Yet, npm install (and calling node build.js) built a binary of a different name for fibers:

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

Node version in dev and production:

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

npm version:

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

Solution

  • This problem appears to have been entirely caused by starting the application with Supervisor (Is supervisor unaware of some aspects of meteor?). Starting the application with systemd produces no such error as below.

    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!```