离子服务器无法在浏览器中呈现

时间:2016-10-14 13:47:17

标签: cordova ionic-framework

我有一个项目,我已经检查了2个不同的文件夹。我试图帮助其他人让项目运行,当它一直失败时,我想我会在另一个文件夹中重试 - 我可以运行ionic serve - 网页启动但页面是空白的我怀疑有一些脚本运行了很长时间。

版本:

  • 离子:2.1.0
  • cordova:6.3.1
  • npm:3.10.3
  • node:6.7.0

我已经运行npm install来安装两个文件夹上的所有依赖项。这些文件夹的内容没有区别 - 它们是从同一个仓库中签出的,并且位于同一个分支上!

修改

我已经从下面的失败运行中附加了控制台: Failed run console

从成功运行: Successful run console

package.json如下:

{
    "name": "...",
    "author": "...",
    "homepage": "...",
    "private": true,
    "config": {
        "ionic_copy": "./config/copy.config.js"
    },
    "scripts": {
        "build": "ionic-app-scripts build",
        "watch": "ionic-app-scripts watch",
        "lint": "ionic-app-scripts lint",
        "copy": "ionic-app-scripts copy",
        "i18n": "node ./scripts/i18n.js",

        "serve:before": "watch",
        "emulate:before": "build",
        "deploy:before": "build",
        "build:before": "build",
        "run:before": "build"
    },
    "dependencies": {
        "@ionic/storage": "^1.0.3",
        "ionic-angular": "^2.0.0-rc.0",
        "ionic-native": "^2.0.3",
        "ionicons": "^3.0.0",
        "moment": "^2.14.1",
        "ng2-translate": "^3.0.0"
    },
    "devDependencies": {
        "@ionic/app-scripts": "^0.0.23",
        "i18next-conv": "^3.0.3",
        "typescript": "^2.0.3"
    },
    "description": "...",
    "cordovaPlugins": [
        "cordova-plugin-device",
        "cordova-plugin-console",
        "cordova-plugin-whitelist",
        "cordova-plugin-splashscreen",
        "cordova-plugin-statusbar",
        "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": []
}

1 个答案:

答案 0 :(得分:0)

所以根据this网站:

  

在开始之前,请确保您拥有稳定的互联网连接,以便节点安装所需的所有模块。

     

首先,创建一个目录以下载应用程序源代码,然后运行:

     
      
  1. npm install -g ionic
  2.   
  3. npm install -g cordova
  4.   

如果我在退房后立即在源文件夹中这样做,我就不再有问题了。