Error: Cannot find module 'fibers'

After upgrading to Meteor 1.4.1.1 I can run my Meteor app without issues locally, but once uploaded to AWS Beanstalk, I am getting the error below. Any help greatly appreciated. (Uninstalling/ReInstalling Meteor did no help). I am using meteor build --server-only …/build --architecture os.linux.x86_64 command to build on Windows if that matters and then deploying to AWS Linux instances.

Error: Cannot find module 'fibers'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/app/current/programs/server/boot.js:1:75)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)

npm ERR! Linux 4.4.51-40.60.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v7.6.0-linux-
x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v7.6.0-linux-
x64/bin/npm" "start"
npm ERR! node v7.6.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
1 Like

Hi @dukeace,

Upon my revisiting of an outdated meteor project repo, I’d been struggling with this exact issue for a good portion of today. Trying uninstall / reinstalls recommended by many of the other posts.

Turned out my primary issue though was using the incorrect version of Node for the version of Meteor being deployed.

To solve, I upgraded to the latest version of Meteor (1.4.4.2 currently) and made sure to be using the correct version of Node (4.8.2 currently, specified here).

Then tried a re-deploy and voila it worked.

Anyway, hope that helps. I know this issue has been floating around seemingly forever and I’ve come across it before in the past. Many of the other forum threads I found didn’t seem to mention this possible solution.

Side thought: Maybe the Meteor Team could consider adding a helpful warning if you’re starting Meteor with an unsupported version of Node?

As I see you’re running on node v7.6.0, maybe this will do the trick. Hope it helps. Cheers!

2 Likes

cd /home/your_app/programs/server
npm install --production

MAKE SURE you do this or you’ll get fiber issues. Good luck friend :slight_smile:

2 Likes

Leaving a note in case somebody else passes this way:

I’m running into the same bug building Meteor 1.6.1 on Windows 10 with node v8.9.4, which is the correct version. Been fooling around with node versions, but no luck yet.

1 Like

Just to clarify, you mean creating a deployment bundle with meteor build?

Nope, just on a regular run of meteor. I’ve gotten it with both 1.6.1 and 1.6.0.1. Was able to get rid of it by running npm install fibers, had to do the same thing for underscore. Now I’m fighting with an EPERM: Operation Not Permitted issue which happens after realpathSync is called on the local/build/programs/server/node_modules symlink. The previous bug was also saying those libraries couldn’t be found from that folder – I get the feeling that the link in there is close to my root cause.

Thanks for looking this over!

Edit: I should add that I’m running from an Administrator PowerShell, so I shouldn’t have any actual permission issues.

So although you must install with an administrator’s PowerShell, you must use your standard user’s PowerShell from that point on. Using the admin PowerShell for working with Meteor will cause problems.

There is absolutely no time I have ever had to install Fibers to run Meteor development on Windows.

Have you installed node.js and npm yourself? If so, uninstall them. Meteor installs the correct versions of these with your applications.

2 Likes

I use node for other reasons than Meteor, uninstalling it isn’t really practical. In fact, I went through the effort of setting up nvm-windows so I could swap between different versions.

Let’s say I’ve already run Meteor under the advanced shell, what’s the best way to solve said problems? Think a meteor reset should do it?

Agreed that installing fibers myself feels very wrong – any clues on what the root cause might be for fibers not being found before?

1 Like

That’s fair enough - I’ve done the same myself. It can cause issues though, so it simplifies things if you can remove it, even if only temporarily.

Probably not - it does remove a lot of stuff, but not everything which may be in the way.

TBH, I’d probably start by checking the Meteor installation. In a normal PowerShell, create the default Meteor app and run it.

meteor create testapp
cd testapp
meteor npm i
meteor

If that works, then by all means try meteor reset, but I suspect it may be easier to start afresh with meteor create newapp --bare, then copy the source (including package.json and .meteor/packages) across from the “broken” app. Then use meteor npm i to regenerate a new npm_modules and take it from there.

If the test app is similarly broken, try a re-install of Meteor.

So now I’ve tried uninstalling my copies of node, creating a testapp, and reinstalling Meteor, still running into the same problem. Still can’t find fibers – seems like some trace is maybe getting left behind somewhere? The choco uninstall & reinstall didn’t fix anything. It seems like maybe things aren’t working the same ever since switching to chocolatey? I think things started going wrong after I tried deleting the local folder to do a reset, although I’m not positive.

I’m at a loss here, any other hunches?

Hmm. I’ve switched to chocolatey without problems. I’m at a bit of a loss now.

I’m thinking the issue might be cached build files not getting removed by the Meteor uninstall. Do you know anything about the build files that get put into C:\Users\<user>\AppData\Local\Temp? I’m pretty sure that all of the mt-<somehash>.<otherhash> folders are all created by the Meteor build, do you know of any other ones?

Also, I really appreciate you taking time out of your busy schedule to help me debug this – thank you.

EDIT: Deleting those temp files didn’t do the trick. I’m downgrading to 1.6.0.1, my last version with a working build, and seeing if anything changes.

I don’t know. I can’t find anything on my system. You may try looking in C:\Users\Admin\AppData\Local and C:\Users\Default\AppData\Local.

The chocolatey Meteor installer files may help.

2 Likes

Hey, I resolved this a few days ago – just posting in case somebody else stumbles here.

At the end of the day, the only solution that worked for my problem was to reset the system. Backed up key files, reinstalled everything, and it worked good as new. That was after numerous reinstallations across major recent versions – very much a last resort measure. But it worked!

I’m still not sure what specifically caused the issue, as it seemed to just appear out of nowhere after a few days of writing code without building. I was using the Windows Insider build of Windows 10. I don’t know enough to say whether this matters, but when I uninstalled Meteor, I used the Revo Uninstaller app which deletes leftover registry keys. There’s a chance it picked up some keys it shouldn’t have, not sure.

Thanks so much for the support, @robfallows – felt like a lifeline when I was freaking out. Wishing you well.

1 Like

Urgh, exactly the same problem here.

Guys, you need to run this:

npm install --production

I’ve got it as part of my startup script now, has been working forever :slight_smile:

1 Like

will try. thanks. if it doesn’t get it fixed or something goes wrong may i ask you questions? i mean, you don’t mind? thanks

Yeah I’m usually around. Cheers,

Oh here’s a link to my Meteor startup script.

Some real gems in there :slight_smile:

I’ve spent the last week on this as well! Still no answer … I’ll probably have to go for the nuclear solution as well. I’ve updated everything and removed caches and node_modules multiple times

You need to: npm install --production