jcoreio / crater

Meteor/Webpack/React SSR app skeleton that runs your app code outside of Meteor Isobuild
ISC License
82 stars 10 forks source link

Error starting dev mode: node-fibers error #4

Closed darkadept closed 8 years ago

darkadept commented 8 years ago

Following the instructions in the README gives me this error when running npm start:

This was on Node v0.11.16 with v2.3.0. I also tried with Node v6.3.0 and got the same error.

mike@THRPC-028:~/dev/crater_debug$ npm start

> crater@1.0.0-alpha.0 start /home/mike/dev/crater_debug
> NODE_ENV=development node src/server/index.js

/home/mike/.meteor/packages/meteor-tool/.1.4.1_1.183vrcm++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/fibers.js:16
        throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe
              ^
Error: `/home/mike/.meteor/packages/meteor-tool/.1.4.1_1.183vrcm++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/bin/linux-x64-v8-3.28/fibers.node` is missing. Try reinstalling `node-fibers`?
    at Object.<anonymous> (/home/mike/.meteor/packages/meteor-tool/.1.4.1_1.183vrcm++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/fibers.js:16:8)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/mike/dev/crater_debug/meteor/.meteor/local/build/programs/server/boot.js:1:75)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
jedwards1211 commented 8 years ago

Ah, there may be something I forgot about when i was first setting up my project. Try running npm rebuild. Also, I've only tested it on Node 5 so far.

darkadept commented 8 years ago

Just tried with Node 5.12.0. Same problem. I'm going to blow away my meteor install and try again to see if it's something to do with my ~/.meteor folder.

jedwards1211 commented 8 years ago

Okay, now I understand -- since Meteor controls that folder it's only building fibers for the version of Node that Meteor is using. So if you're using a different version than Meteor does you'll have to rebuild it manually. This fixed the issue for me:

/home/mike/.meteor/packages/meteor-tool/.1.4.1_1.183vrcm++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib
npm rebuild fibers

Maybe I can eventually dig deeper into what Meteor's boot.js does and make my package do essentially the same thing without running it, so that it has control over what node versions these packages are built for.

darkadept commented 8 years ago

Awesome! That works. Works on Node 6.3.0 too.

I assume you'd have to rebuild every time you change a node version, right? Does running that rebuild potentially cause problems for other meteor apps that also use meteor 1.4.1.1? Or should I only use the exactly node version that meteor is using?

Thanks!

jedwards1211 commented 8 years ago

If you ls node_modules/fibers/bin in that directory, you'll see that it keeps around binaries for various versions of node (the versions in the binary file names don't correspond directly to node versions, I think they correspond to v8 versions or something related). So if you have to rebuild for a different node version, you'll only have to do it before using that node version for the first time (or, since the Meteor version is in that folder name, probably when you change meteor versions as well)

But I'm sure the binaries don't have to be rebuilt for every minor change...I'm not 100% sure how they semver it because it seemed like I had to rebuild binaries when switching from 6.3.0 to 6.5.0.

Also, you can actually just run npm rebuild without any specific package.

jedwards1211 commented 8 years ago

I'd officially recommend using Node 4, since that's what Meteor 1.4 uses and 4 is the long-term support version...but I use Node 5 in most of my projects right now.

jedwards1211 commented 8 years ago

I put instructions about this in the readme, so I'm closing this