构建流星应用程序后,Meteor无法运行 [英] Meteor fails to run after building a meteor app

查看:154
本文介绍了构建流星应用程序后,Meteor无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,所以我使用命令

meteor build bundle --debug --server https://(my app url hosted on meteor)

meteor确实用cordova android pack和tar.gz文件构建了一个捆绑文件夹.

meteor did built a bundle folder with cordova android pack and a tar.gz file.

构建应用后,我试图点击

after building the app , im trying to hit

meteor

但是我遇到了很多错误:

but i get a bunch of errors:

While Building the application:
bundle/android/project/cordova/lib/android_sdk_version.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/appinfo.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/build.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/check_reqs.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/clean.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/device.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/emulator.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/exec.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/log.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/run.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/spawn.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/node_modules/shelljs/scripts/generate-docs.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/node_modules/shelljs/scripts/run-tests.js:1:15: Unexpected token ILLEGAL
bundle/android/project/assets/www/application/head.html:1: bad formatting in HTML template
bundle/android/project/assets/www/application/index.html:1: Can't set DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)

在这些js文件中查看,我看到引起错误的代码行,即:

viewing inside those js files i see the line of code that makes the error, which is:

#!/usr/bin/env node

请注意,因为phonegap和cordova为我输出了一个错误:"/usr/bin/env: node: No such file or directory"

note because phonegap and cordova outputted for me an error :"/usr/bin/env: node: No such file or directory"

我尝试使用ln -s /usr/bin/nodejs /usr/bin/node

当然删除bundle文件夹并单击"meteor",不会输出任何错误日志,并且应用程序运行正常.

of course deleting the bundle folder and hitting "meteor" , does not outputs any error logs and the app is running perfectly.

我想科尔多瓦的建造存在某种错误...

i guess there is some sort of error with the cordova build...

推荐答案

根据Slava:

Meteor会拾取项目文件夹中的所有javascript文件,包括嵌套文件夹.通过将捆绑软件保存在与项目相同的目录中,您仅复制了许多文件,现在Meteor将把它们选作新的源文件".为避免这种情况,请将捆绑包输出到项目的单独目录中,或输出到Meteor构建工具忽略的隐藏文件夹(任何以点开头的文件夹名称).

Meteor picks up all javascript files in your project's folder including nested folders. By saving your bundle in the same directory as your project, you just duplicated a lot of files and now Meteor is going to pick them up as "new source files". To avoid this, output your bundles to a separate directory from your project or to a hidden folder that is ignored by Meteor build tool (any folder name starting with a dot).

看看流星科尔多瓦的phonegap集成:

take a look at meteor cordova phonegap integration:

meteor-cordova-phonegap-integration

meteor build <bundle path> --server <host>:<port>

  • *文件夹(示例主文件夹)

    • *folder (example home folder)

      **子文件夹(项目的根目录)(例如myMeteorApp)

      **subfolder (root of project) (example myMeteorApp)

      因此,为了使事情发生,请尝试考虑将您放在应用程序的根文件夹中:

      so in order to make things happen try doing consider your on root folder of your app:

      meteor build .bundle --debug --server https://(your app url hosted on meteor)//将生成隐藏的direcotrey及其内部版本.

      meteor build .bundle --debug --server https://(your app url hosted on meteor) //will generate hidden direcotrey with the build inside it.

      导致:

      • *文件夹(例如主文件夹)
      • **子文件夹(项目的根目录)(例如myMeteorApp)
      • ***.bundle(根应用文件夹中的隐藏文件夹)

      meteor build ../bundle --debug --server https://(your app url hosted on meteor)//将生成一个内部结构为direcotrey的

      meteor build ../bundle --debug --server https://(your app url hosted on meteor) //will generate a direcotrey with the build inside it .

      导致:

      • *文件夹(例如主文件夹)
      • **子文件夹(项目的根目录)(例如myMeteorApp)
      • **捆绑包(主文件夹中的文件夹)

      这篇关于构建流星应用程序后,Meteor无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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