I want to run the most basic Meteor app via Node. I make the following, orderly;
- mkdir src && cd src
- meteor create sample_app
- npm install --production
- meteor build … --allow-superuser --directory
- cd …/bundle
- node --version
v4.6.1
- node main.js
But, it throws the following error;
module.js:327
throw err;
^
*Error: Cannot find module 'fibers’
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.
(/server/boot.js:1:75)
at Module._compile (module.js:409:26)
at Object.Module._extensions…js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)*
Why cannot I run the most basic Node app via those simple steps? Thank you!
This may have something to do with the new architecture of the meteor bundle (the process which converts a Meteor app to a regular Node.js app).
In Meteor < 0.9 you had to run npm install at the root of the bundle to get npm modules installed, now you have to cd in programs/server first, as stated in the README :
Modulus developed a tool called
demeteorizer
which is supposed to automate this process of converting a Meteor app to a Node.js app, and it's possible that they have not yet modified the tool to account for 0.9 changes.You simply need to
and possibly export environment variables first, depending on what you need in your application.
After that you just run the bundled app with node
After you create a meteor project.
meteor build --server-only .
xyz.tar.gz
will be created for you. Use commandtar -xzf xyz.tar.gz
to untar it.bundle/programs/server/
and then run commandnpm install --production
export MONGO_URL=”mongodb://username:password@127.0.0.1:27017/dbName”;export ROOT_URL=”http://localhost/”;export PORT=3000
bundle/
directory and run pm2 using commandpm2 start --name “UID” main.js
.pm2 show 0