23

The bundled node.fibers fails to load after deployment to a different server with the following error:

/home/ec2-user/bundle/server/node_modules/fibers/fibers.js:13
    throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe
          ^
Error: `/home/ec2-user/bundle/server/node_modules/fibers/bin/linux-x64-v8-3.11/fibers.node` is missing. Try reinstalling `node-fibers`?
    at Object.<anonymous> (/home/ec2-user/bundle/server/node_modules/fibers/fibers.js:13:8)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/ec2-user/bundle/server/server.js:3:1)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
Ola Wiberg
  • 1,679
  • 1
  • 13
  • 14
  • In case this would be of use to you, here's an EC2 install script for Meteor: https://gist.github.com/matb33/5322002 – matb33 Apr 05 '13 at 23:31

3 Answers3

56

Node fibers have to be re-installed after unpacking the bundle. To fix this problem go to the server directory.

$ cd bundle/programs/server

Then un-install fibers

$ npm uninstall fibers

Then install fibers

$ npm install fibers

Then start your application

$ cd ../../
$ PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp node bundle/main.js

You will have to repeat that every time you update the app. This is just the way Meteor uses Node at the moment. Potential long-term fix can be found here: http://meteorhacks.com/how-meteor-uses-node.html

NOTE: On Meteor 0.6.5 and Node 0.10.* this may work slightly differently. You may have to remove fibers manually from bundle/server as well as bundle/programs/server. You can do that with $ rm -R node_modules/fibers. Then you'll have to reinstall fibers from both locations with $ npm install fibers.

aman_novice
  • 1,027
  • 3
  • 13
  • 31
Ola Wiberg
  • 1,679
  • 1
  • 13
  • 14
  • 8
    Thanks for pointing out that the fibers module needs to be installed INSIDE of the server folder. Everybody else missed that very important detail. – 0x6A75616E Apr 26 '13 at 05:51
  • 1
    Why is it necessary to re-install fibers? None of the other node modules bundled with the server need to be re-installed? The reademe created with the bundle says that you need in INSTALL fibers, but it doesn't mention UNINSTALLING first. This appears to be an oversight. – Charles Holbrow May 28 '13 at 05:51
  • 7
    Installing in `bundle/programs/server` as opposed to only `bundle/server`is the key to get this working. – Curious2learn Sep 22 '13 at 04:32
  • 1
    Not working for me with Meteor 0.6.5.1 on Linux. Console just hangs when I run "node main.js". I tried an "strace", which reveals that it gets stuck on "epoll_wait(5," – Graeme P Sep 25 '13 at 10:56
  • 1
    @GraemePyle I have the same problem, console hangs. – Phuoc Do Oct 10 '13 at 22:53
  • @graemepyle I upgrade meteor to 0.6.6. Fixed the issue. – Phuoc Do Oct 11 '13 at 02:11
  • for those here reading with Windows10, npm 3.6.0, node 5.8.0, meteor 1.2.1, I had to uninstall fibre in C:/users//node_modules... I did not have to reinstall it, either, when using `iron create my-project`, it did automatically install it correctly – IceFire Mar 13 '16 at 15:40
  • Iam facing the same issue..But its running on bluemix..Can someone help me out how we can fix this – user7350714 May 23 '17 at 06:13
  • Just putting here in case there are other people having this issue. I did `npm install fibers@3` as suggested in the fibers's documentation to make it work with node 8.9.4. My npm version is `6.5.0` and the npm inside meteor is `5.6.0`. Doing `meteor npm install fibers@3` inside `bundle/programs/server` didn't work for me, but doing `npm install fibers@3` worked. – Murillo Ferreira Aug 26 '19 at 15:08
  • Guys, this is a global package, no need to attach it to your project. $ rm -R node_modules/fibers and then $ npm install fibers -g – MetaTron Dec 13 '21 at 16:03
2

I had the same issue with Meteor 1.0.3.2 and Node 0.12.0. I had to downgrade to Node 0.10.31. This fixed the issue.

Remember all instructions are in the readme file in the bundle folder.

gpasse
  • 4,380
  • 7
  • 44
  • 75
2

Mismatched Node Versions

The versions of node MUST match when you do the npm install and when you run the meteor app: node app.js.

Otherwise you can end up with different versions of expected glibc folders...

To see if you have this problem:

  1. note the runtime error you are seeing. For example, in my case:
Try running this to fix the issue: /usr/bin/node <bundle location>/bundle/programs/server/node_modules/fibers/build
Cannot find module '<bundle location>/bundle/programs/server/node_modules/fibers/bin/linux-x64-83-libc/fibers`
  • The fix instructions referred to /usr/bin/node even though I was managing my node version via nvm.
  • The executable was looking for fibers in the linux-x64-83-libc folder.
  1. navigate to bundle/programs/server/node_modules/fibers/bin & examine your glibc subfolders. In my case: linux-x64-57-glibc & linux-x64-64-glibc
  • My executable is looking for linux-x64-83-libc & it does not exist.

Notes

In my case I was using nvm to manage my node versions. But as I could see in the fix instructions, my executable was using /usr/bin/node and not the nvm version I was expecting.

Fix

I removed the /usr/bin/node version via sudo apt-get remove nodejs and all was good. Everything started using the nvm version.

BruceJo
  • 591
  • 6
  • 17
  • `sudo apt-get uninstall nodejs` is not correct, use `sudo apt-get remove nodejs` instead – Tisch Feb 22 '22 at 12:37