在Azure上部署MeteorJS和React应用 [英] Deployment of MeteorJS and React app on Azure

查看:58
本文介绍了在Azure上部署MeteorJS和React应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照本教程 https://www.phusionpassenger.com/library/walkthroughs/deploy/meteor/aws/apache/oss/xenial/deploy_app.html

Localhost:节点v6.9.4,Meteor 1.6.0.1服务器:v6.12.2,Meteor 1.6.0.1

Localhost: node v6.9.4, Meteor 1.6.0.1 Server: v6.12.2, Meteor 1.6.0.1

我已经将完全相同的文件推送到了heroku,并且可以正常工作.我按照相同的步骤将另一个项目推送到Azure,并且它也有效.因此,此项目中有一些Azure不喜欢的特别之处:(

I've pushed absolutely the same files to heroku and it works. I've pushed a different project to Azure following the same steps and it also works. Therefore, there is something particular in this project that Azure does not like :(

在我的本地服务器上,一切正常,但在服务器上却无法正常工作.在Apache/var/log/apache2/error.log中,出现以下错误:会是什么?

On my local server everything works fine, but on the server it does not work. In Apache /var/log/apache2/error.log I get the following error: What could it be?

[ E 2017-12-13 11:48:02.9289 10769/Tb age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 3-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 0305fa70. Please see earlier logs for details about the error.
[ E 2017-12-13 11:48:02.9289 10769/Td age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 4-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 0305fa70. Please see earlier logs for details about the error.
App 27630 stdout: 
App 27630 stderr: Note: you are using a pure-JavaScript implementation of bcrypt.
App 27630 stderr: While this implementation will work correctly, it is known to be
App 27630 stderr: approximately three times slower than the native implementation.
App 27630 stderr: In order to use the native implementation instead, run
App 27630 stderr: 
App 27630 stderr:   meteor npm install --save bcrypt
App 27630 stderr: 
App 27630 stderr: in the root directory of your application.
App 27630 stdout: Shops collection was empty, adding shops from scratch...
App 27630 stderr: /var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
App 27630 stderr:                       throw(ex);
App 27630 stderr:                       ^
App 27630 stderr: 
App 27630 stderr: TypeError: Object.getOwnPropertyDescriptors is not a function
App 27630 stderr:     at insert (packages/mongo/collection.js:435:12)
App 27630 stderr:     at shops.js (imports/api/shops.js:10:11)
App 27630 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27630 stderr:     at require (packages/modules-runtime.js:238:16)
App 27630 stderr:     at main.js (server/main.js:1:208)
App 27630 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27630 stderr:     at require (packages/modules-runtime.js:238:16)
App 27630 stderr:     at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
App 27630 stderr:     at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
App 27630 stderr:     at Array.forEach (native)
[ E 2017-12-13 11:49:15.3011 10769/Tr age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/onecherry/bundle: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger.
  Error ID: cc5e5c15
  Error details saved to: /tmp/passenger-error-DVtWtb.html
  Message from application: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

  meteor npm install --save bcrypt

in the root directory of your application.
Shops collection was empty, adding shops from scratch...
/var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
                        throw(ex);
                        ^

TypeError: Object.getOwnPropertyDescriptors is not a function
    at insert (packages/mongo/collection.js:435:12)
    at shops.js (imports/api/shops.js:10:11)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at main.js (server/main.js:1:208)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
    at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
    at Array.forEach (native)
</pre>

[ E 2017-12-13 11:49:15.3052 10769/T7 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is cc5e5c15. Please see earlier logs for details about the error.
App 27654 stdout: 
App 27654 stderr: Note: you are using a pure-JavaScript implementation of bcrypt.
App 27654 stderr: While this implementation will work correctly, it is known to be
App 27654 stderr: approximately three times slower than the native implementation.
App 27654 stderr: In order to use the native implementation instead, run
App 27654 stderr: 
App 27654 stderr:   meteor npm install --save bcrypt
App 27654 stderr: 
App 27654 stderr: in the root directory of your application.
App 27654 stdout: Shops collection was empty, adding shops from scratch...
App 27654 stderr: /var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
App 27654 stderr:                       throw(ex);
App 27654 stderr:                       ^
App 27654 stderr: 
App 27654 stderr: TypeError: Object.getOwnPropertyDescriptors is not a function
App 27654 stderr:     at insert (packages/mongo/collection.js:435:12)
App 27654 stderr:     at shops.js (imports/api/shops.js:10:11)
App 27654 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27654 stderr:     at require (packages/modules-runtime.js:238:16)
App 27654 stderr:     at main.js (server/main.js:1:208)
App 27654 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27654 stderr:     at require (packages/modules-runtime.js:238:16)
App 27654 stderr:     at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
App 27654 stderr:     at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
App 27654 stderr:     at Array.forEach (native)
[ E 2017-12-13 11:49:17.4650 10769/Tu age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/onecherry/bundle: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger.
  Error ID: be5123f1
  Error details saved to: /tmp/passenger-error-BBAMEZ.html
  Message from application: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

  meteor npm install --save bcrypt

in the root directory of your application.
Shops collection was empty, adding shops from scratch...
/var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
                        throw(ex);
                        ^

TypeError: Object.getOwnPropertyDescriptors is not a function
    at insert (packages/mongo/collection.js:435:12)
    at shops.js (imports/api/shops.js:10:11)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at main.js (server/main.js:1:208)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
    at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
    at Array.forEach (native)
</pre>

[ E 2017-12-13 11:49:17.4693 10769/T9 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 2-2] Cannot checkout session because a spawning error occurred. The identifier of the error is be5123f1. Please see earlier logs for details about the error.

这是shops.js文件的内容

This is the content of shops.js file

import {Meteor} from 'meteor/meteor';
import {Mongo} from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';

export const Shops = new Mongo.Collection('shops');

if (Meteor.isServer) {
  if (Shops.find().fetch().length == 0) {
    console.log('Shops collection was empty, adding shops from scratch...');
    Shops.insert({
      organisation: 'Shelter Scotland',
      address: "134 Nicolson St, Edinburgh EH8 9EH",
      openingHours: {
        'Mon': '10.00am - 5.45pm',
        'Tue': '10.00am - 5.45pm',
        'Wed': '10.00am - 5.45pm',
        'Thu': '10.00am - 5.45pm',
        'Fri': '10.00am - 5.45pm',
        'Sat': '10.00am - 5.45pm',
        'Sun': '11.00am - 4.00pm'
      },
      secretCode: 6543652765
    })
  } else {
    console.log('shops collection is not empty');
  }

  Meteor.publish('shopsPublication', function() { 
    return Shops.find({});
  });

}

推荐答案

我已经更新了服务器和应用程序上的所有依赖项.现在一切正常!尤其是npm和node软件包.

I've updated all dependencies on the server and my app. Now it all works! Especially npm and node packages.

这篇关于在Azure上部署MeteorJS和React应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆