There are already a few questions around here related to this question.
I want to deploy a meteorjs app to the official meteor servers. My application uses fibers, and since fibers is compiled for my system ( Mac OSX ) it creates an error on the ubuntu servers by meteor.
The other questions/answers are related to deploying the app somewhere else than the official meteor servers or they seem to leave a step out, since they don't work for me.
A few of the related posts are these:
Reinstalling node-fibers for a Meteor app on Modulus.io?
Problems with Meteor deployment related to fibers module
I would like to use:
meteor deploy myapp.meteor.com
EDIT:
My question above was not complete unfortunately, I use Future, which is part of fibers. When I deploy it to meteor and access the server logs, I get these WARNINGs and the applications crashes right after.
WARNING /meteor/dev_bundles/0.3.13/lib/node_modules/fibers/future.js:173
WARNING Error: Cannot find module 'fibers/Future'
In my code I have the line:
Future = Npm.require("fibers/future");
Is this not possible on meteor deploy XXX.meteor.com ?
EDIT 2nd: Instead of using:
Future = Npm.require("fibers/future");
I also tried:
var path = Npm.require('path');
var fs = Npm.require('fs');
var base = path.resolve('.');
var isBundle = fs.existsSync(base + '/bundle');
var modulePath = base + (isBundle ? '/bundle/static' : '/public') + '/node_modules';
Future = Npm.require(modulePath + '/fibers/future');
As suggested in this post:
How can I deploy node modules in a Meteor app on meteor.com?
And installed fibers to:
.meteor/local/build/programs/server/public/node_modules/
But with this I get either this when running meteor without sudo Error: EACCES, permission denied 'XXXX/.meteor/local/build' at Object.fs.renameSync (fs.js:439:18)
Or this error, when running it with sudo: Error: Cannot find module 'XXXX/.meteor/local/build/programs/server/public/node_modules/fibers/future'
Usually I run meteor without sudo ofc!
You need to just uninstall the fibers and reinstall it on your server as mentioned in the docs:
Where the bundle directory is the untarred version of the bundled app you created via
meteor bundle xxx.tar.gz
on your ubuntu serverfrom the meteor documentation it is clear that you can deploy to meteor.com with ´meteor deploy´ or to your own server by creating a bundle with ´meteor bundle´.
It is only when you create your bundle that you need to install ´fibers´. If you use ´meteor deploy´ there is no need.
The part where you have to remove and reinstall the fibers package is only required if you want to deploy like this
When creating the bundle, you have to install fibers in any case. If you do it all on the server the steps are:
these steps assume you use the node package forever
My problem was that I did include the npm package for loading another framework, which broke the new Npm by meteor.