当我运行离心运行android -lc'时,Console.log不显示

时间:2017-01-22 17:28:48

标签: ionic-framework console.log package.json

当我运行离线运行android -lc'

时,我的console.logs停止显示

当我在网络浏览器中点击它时会显示。

基于此post我试图将此行添加到我的package.json文件中:

"scripts": { "ionic:build": "ionic-app-scripts build", "ionic:watch": "ionic-app-scripts watch" }

但是当我做一个离子构建android'时,它会给我一个错误。说' ionic-app-scripts'不承认:

enter image description here

这是我的json.package,我突出了我添加的内容。

enter image description here

我试图删除' ionic-app-scripts'在我的package.json中行,它构建正确,但仍然没有记录。

感谢任何帮助。

感谢。

更新:

我刚刚重新启动了一个完全空白的副本,其中“离子启动时刻空白”#39;我将我的www文件夹复制到干净的应用程序中。然后我做了一个npm安装并运行我的应用程序。我还没有得到console.logs。由于我的www文件夹中的代码,这可能会以某种方式发生吗?我不明白这一点。有任何想法吗?我在Ionic 1上运行。

1 个答案:

答案 0 :(得分:1)

假设这是一款Ionic 2应用,您错过了@ionic/app-scripts的{​​{1}}依赖关系。

最新消息是:package.json

基本完全工作的离子2 package.json示例可以在Ionic的会议应用程序演示(https://github.com/driftyco/ionic-conference-app)中找到:

@ionic/app-scripts": "1.0.0"

注意{ "name": "ionic-conference-app", "description": "Ionic Conference App", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/driftyco/ionic-conference-app.git" }, "scripts": { "build": "ionic-app-scripts build", "clean": "ionic-app-scripts clean", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { "@angular/common": "2.2.1", "@angular/compiler": "2.2.1", "@angular/compiler-cli": "2.2.1", "@angular/core": "2.2.1", "@angular/forms": "2.2.1", "@angular/http": "2.2.1", "@angular/platform-browser": "2.2.1", "@angular/platform-browser-dynamic": "2.2.1", "@angular/platform-server": "2.2.1", "@ionic/storage": "1.1.7", "ionic-angular": "2.0.0-rc.5-201701112208", "ionic-native": "2.2.11", "ionicons": "3.0.0", "rxjs": "5.0.0-beta.12", "sw-toolbox": "3.4.0", "zone.js": "0.6.26" }, "devDependencies": { "@ionic/app-scripts": "1.0.0", "typescript": "2.0.9" } } 这里。 要确保干净的构建,请删除当前的@ionic/app-scripts文件夹,并在添加所需的依赖项后重新执行node_modules