8

I have been working with Meteor apps for a few months. For the first time, anytime I try to run a meteor app, install via (curl https://install.meteor.com | /bin/sh) or run meteor update, I get this error:

module.js:340
    throw err;
          ^
Error: Cannot find module 'fibers'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/usr/local/meteor/app/meteor/meteor.js:1:75)
    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.runMain (module.js:492:10)

In the past I'd get random js errors and reinstalling would fix, but I cannot even run the installer or update now. Perhaps it is related to 0.6. Thanks for any insight!

Geoffrey Booth
  • 7,168
  • 5
  • 35
  • 42
ppedrazzi
  • 787
  • 2
  • 10
  • 23

6 Answers6

25

This solution worked for me:

  1. Install the latest Node via the graphical installer at http://nodejs.org/ EDIT: should not be necessary.
  2. Install Fibers via sudo npm install fibers@1.0.1 -g per @Akshat EDIT: should not be necessary.
  3. Delete the file /usr/local/bin/meteor
  4. Delete the folder ~/.meteor
  5. curl https://install.meteor.com/ | sh
Geoffrey Booth
  • 7,168
  • 5
  • 35
  • 42
8

I had this happen (again) and did more research. I ended up doing these two steps to address it:

Remove Meteor:

rm -rf /usr/local/meteor /usr/local/bin/meteor

Install Meteor:

curl https://install.meteor.com | /bin/sh
ppedrazzi
  • 787
  • 2
  • 10
  • 23
1

I ended up going to my working computer, grabbing the usr/local/bin files and copy/pasting to the non-working computer. May not be ideal, but it got the job done and I am back coding on both machines. Thank you Akshat very much for the diligence on this issue!

Paul

ppedrazzi
  • 787
  • 2
  • 10
  • 23
  • npm is not a mess .. been working just fine for many months ... above issue is meteor related and how to does its layer of package management atop of npm – Scott Stensland Dec 04 '15 at 18:40
0

Try restarting your computer/reloading a terminal because the new meteor is installed in a new location too (it looks like yours is still at /usr/local instead of ~/.meteor)

If that doesn't work install fibers with npm install fibers@1.0.0 -g.

Tarang
  • 75,157
  • 39
  • 215
  • 276
  • Still stuck, but you might be onto something with the path. I use 2 computers to develop. All meteor apps are in dropbox and shared. On the laptop I upgraded to 0.6. On the computer with this js error I have NOT updated. If I try, I get the error. I would still think a simple re-install would work, but no luck. I did restart my mac too, but same issue. – ppedrazzi Apr 06 '13 at 14:29
  • Tried npm install and had errors as well: npm ERR! Error: EACCES, open '/Users/ppedrazzi/.npm/ff36e769-fibers-1-0-0.lock' npm ERR! { [Error: EACCES, open '/Users/ppedrazzi/.npm/ff36e769-fibers-1-0-0.lock'] npm ERR! errno: 3, npm ERR! code: 'EACCES', ... – ppedrazzi Apr 06 '13 at 14:33
  • try with sudo `npm install fibers@1.0.0 -g` – Tarang Apr 06 '13 at 14:34
  • done, but meteor install still does not work. Here was the log from terminal with sudo npm command: npm http GET https://registry.npmjs.org/fibers/1.0.0 npm http 200 https://registry.npmjs.org/fibers/1.0.0 npm http GET https://registry.npmjs.org/fibers/-/fibers-1.0.0.tgz npm http 200 https://registry.npmjs.org/fibers/-/fibers-1.0.0.tgz > fibers@1.0.0 install /usr/local/lib/node_modules/fibers > node ./build.js `darwin-x64-v8-3.14` exists; skipping build fibers@1.0.0 /usr/local/lib/node_modules/fibers – ppedrazzi Apr 06 '13 at 14:35
  • Try `npm cache clean` first if that doesn't help then try reinstall meteor by running sudo -s then calling that curl install script. – Tarang Apr 06 '13 at 14:35
  • cleaned cache --- same error --- module.js:340 throw err; ^ – ppedrazzi Apr 06 '13 at 14:39
  • Forcibly remove the .lock file at Users/ppedrazzi/.npm/ff36e769-fibers-1-0-0.lock. Also when you initially installed meteor on this machine before did you use npm install on sudo but without the -g perhaps a while ago? – Tarang Apr 06 '13 at 14:40
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/27698/discussion-between-akshat-and-ppedrazzi) – Tarang Apr 06 '13 at 14:43
  • Could you try also removing node fibers, both the global one and the local one so that its completely fresh when you install meteor? This one should work.. – Tarang Apr 06 '13 at 19:10
  • I'll give it a run Akshat, but could you advise on finding those files? I am not a node expert. Thank you kindly. – ppedrazzi Apr 06 '13 at 19:47
0

I came across this problem too. As it turns out it was a permissions problem with meteor installed on my mac as root. I reinstalled meteor as the logged in user (with files that are in ~/.meteor). Everything then worked fine.

Mark
  • 1
0

When you bundle / build meteor on one environment (i.e. OS X) and then try to deploy on a different environment (i.e. Ubuntu) it seems that meteor includes the wrong libraries.

I could be wrong in this, in any case I found that uninstalling and re-installing the bcrypt library worked for me (well at least it got me to the point where I get other errors)

Find the directory where npm list bcrypt exists, then type npm remove bcrypt and then npm install bcrypt.

In Meteor V1.2 this is easy to find. In Meteor V1.3 I think it's in .../bundle/programs/server/npm/node_modules/meteor/npm-bcrypt

Zach Smith
  • 8,458
  • 13
  • 59
  • 133