2015-07-21 24 views
5

meteor yerine node ile bir Meteor Uygulaması nasıl başlatılır.Meteor Uygulaması, meteor yerine düğüm ile başlatılabilir mi?

$ 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 

Belki daha yapılandırmaları gerekir: Bu denedim?

+4

Uygulama kurulduktan sonra üretimde çalışırken, meteor uygulamasıyla bir meteor uygulaması başlatmak normaldir. İlgilendiğin şey bu mu? –

+0

Evet biliyorum ama uygulamayı olabildiğince kuru başlatmak güzel olurdu. Mümkün olduğu kadar az önce ve sonradan işlenir. Hata ayıklama ile deney yapıyoruz. Yani gelişime yakın bir devlet mükemmel olurdu. –

+0

Her meteor başlattığınızda, onu çalıştırmak için node.js'yi başlatır. Bu bir ambalaj meselesi. Detailes için cevaba bakın –

cevap

1

Sadece demeteorizer kullanabilirsiniz: DEMETEORiZER ON GITHUB

Eğer NPM ile yüklendikten sonra sizin meteor uygulama kataloğunda gidip gibi kullanın: [path] --output demeteorizer

Sonra yoluna gitmeniz

npm install 

meteor uygulamalar aşağıdaki ortam değişkenlerine faydalanmak: o [yol] parametre olarak var verdi

MONGO_URL = 'mongodb: // kullanıcı: şifre @ konak:? Portu/databasename autoreconnect = true'
ROOT_URL = 'http://example.com '
MAIL_URL =' smtp: // kullanıcı: şifre @ mailhost: port /' (isteğe bağlı)
PORT = 8080 (80 opsiyonel, varsayılan)

(besbelli yukarıda doğru yerlerde parametreleri yerleştirmek)

npm start 
Bu gerçekten tavsiye ederim. Basit, mükemmel ve hızlı çalışır.