Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to start a Meteor App with node instead of meteor?

How to start a Meteor App with node instead of meteor. I' ve tried this:

$ meteor create m;
m: created.

To run your new app:
  cd m
  meteor

$ cd m;

$ meteor;
[[[[[ c:\git\m ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/
   Type Control-C twice to stop.

# OK! This works :O)

$ node .meteor\local\build\main.js;
module.js:338
    throw err;
          ^
Error: Cannot find module 'fibers'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (c:\git\m\.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)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

$ node .meteor\local\build\main.js;

# OK! This does not work :O(

$ cd .meteor\local\build\;

$ npm install fibers;
$ npm install semver;
$ npm install source-map-support;
$ npm install underscore;

$ node main.js
$ c:\git\m\.meteor\local\build\node_modules\fibers\future.js:267
                                                throw(ex);
                                                      ^
Error: Must pass options.rootUrl or set ROOT_URL in the server environment
    at Object.Meteor.absoluteUrl (packages/meteor/url_common.js:21:1)
    at Object.WebAppInternals.generateBoilerplate (packages/webapp/webapp_server.js:543:1)
    at Object.main (packages/webapp/webapp_server.js:739:1)
    at c:\git\m\.meteor\local\build\programs\server\boot.js:255:27

$ set ROOT_URL=localhost:3000;

$ set ROOT_URL;
ROOT_URL=localhost:3000

$ node main.js
c:\git\m\.meteor\local\build\programs\server\boot.js:263
}).run();
   ^
TypeError: Cannot read property 'slice' of null
    at packages/meteor/url_server.js:11:1
    at c:\git\m\.meteor\local\build\programs\server\packages\meteor.js:1098:4
    at c:\git\m\.meteor\local\build\programs\server\packages\meteor.js:1240:3
    at c:\git\m\.meteor\local\build\programs\server\boot.js:222:10
    at Function._.each._.forEach (c:\git\m\.meteor\local\build\node_modules\underscore\underscore.js:153:9)
    at c:\git\m\.meteor\local\build\programs\server\boot.js:117:5

Maybe it needs more configurations?

like image 337
Stephan Ahlf Avatar asked Nov 09 '22 08:11

Stephan Ahlf


1 Answers

You can simply use demeteorizer: DEMETEORiZER ON GITHUB

After you install it with NPM go to your meteor app catalog and use like: demeteorizer --output [path]

Then go to the path you have gave in [path] parameter, then:

npm install

Meteor applications make use of the following environment variables:

MONGO_URL='mongodb://user:password@host:port/databasename?autoReconnect=true'
ROOT_URL='http://example.com'
MAIL_URL='smtp://user:password@mailhost:port/' (optional)
PORT=8080 (optional, defaults to 80)

(obviously place your parameters in right places in above)

npm start

I really recommend this sollution. Is simple, works perfect and fast.

like image 105
Paweł Smołka Avatar answered Nov 14 '22 21:11

Paweł Smołka