【问题标题】:2 ionic not creating the main.css and main.js2 离子没有创建 main.css 和 main.js
【发布时间】:2016-10-22 11:25:33
【问题描述】:

我在装有 Windows 10 的计算机上遇到一个非常奇怪的问题,离子服务无法编译文件并出现以下错误,更多的是在另一台计算机上相同的应用程序可以正常工作并且编译没有错误,有人可以帮助我吗?

ionic serve

Running 'serve:before' npm script before serve

> TraduzindoSonhos@ watch C:\Users\Breno\Dropbox\Apps\TraduzindoSonhos\TraduzindoSonhos
> ionic-app-scripts watch

[09:15:23]  ionic-app-scripts 0.0.36
[09:15:23]  watch started ...
[09:15:23]  build dev started ...
[09:15:23]  clean started ...
[09:15:23]  clean finished in 15 ms
[09:15:23]  copy started ...
[09:15:24]  transpile started ...
[09:15:24]  lint started ...
[09:15:28]  tslint: ...reno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/services/bmbraga.http.ts,
            line: 4
            Unused import: 'Response'

       L3:  import { Injectable }     from '@angular/core';
       L4:  import { Http, Response, Headers, RequestOptions } from '@angular/http';
       L5:  import {Observable} from 'rxjs/Rx';

[09:15:28]  tslint: ...reno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/services/bmbraga.http.ts,
            line: 4
            Unused import: 'Headers'

       L3:  import { Injectable }     from '@angular/core';
       L4:  import { Http, Response, Headers, RequestOptions } from '@angular/http';
       L5:  import {Observable} from 'rxjs/Rx';

[09:15:28]  tslint: ...reno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/services/bmbraga.http.ts,
            line: 4
            Unused import: 'RequestOptions'

       L3:  import { Injectable }     from '@angular/core';
       L4:  import { Http, Response, Headers, RequestOptions } from '@angular/http';
       L5:  import {Observable} from 'rxjs/Rx';

[09:15:28]  tslint: ...reno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/services/bmbraga.http.ts,
            line: 5
            Unused import: 'Observable'

       L4:  import { Http, Response, Headers, RequestOptions } from '@angular/http';
       L5:  import {Observable} from 'rxjs/Rx';

[09:15:28]  tslint: ...ox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/item-details/item-details.ts,
            line: 88
            Unused variable: 'alert'

      L87:  console.log("login error: " + JSON.stringify(error));
      L88:  try {
      L89:      let alert = this.alertCtrl.create({

[09:15:28]  tslint: ...sers/Breno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/home/home.ts,
            line: 2
            Unused import: 'NavParams'

       L1:  import { Component } from '@angular/core';
       L2:  import { NavController, NavParams, Platform } from 'ionic-angular';
       L3:  import { AlertController } from 'ionic-angular';

[09:15:28]  tslint: ...sers/Breno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/home/home.ts,
            line: 99
            Unused variable: 'alert'

      L98:  try {
      L99:      let alert = this.alertCtrl.create({
     L100:              title: 'Server error',

[09:15:28]  tslint: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/letter-result/letter-result.ts,
            line: 98
            Unused variable: 'alert'

      L97:  try {
      L98:      let alert = this.alertCtrl.create({
      L99:              title: 'Server error',

[09:15:28]  tslint: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/search-result/search-result.ts,
            line: 85
            Unused variable: 'alert'

      L84:  try {
      L85:      let alert = this.alertCtrl.create({
      L86:              title: 'Server error',

[09:15:28]  lint finished in 4.17 s
[09:15:30]  typescript: ...rs/Breno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/app/app.component.ts,
            line: 37
            Property 'analytics' does not exist on type 'Window'.

      L36:  try {
[09:15:30]  typescript: ...sers/Breno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/home/home.ts,       L37:
        window.            line: 27 a
nal[09:15:30]  typescript: ...sers/Breno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/home/home.ts, y
t            line: 34
i[09:15:30]  typescript: ...sers/Breno/Dropbox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/home/home.ts, c
            line: 68 s
.startTrackerWithId("UA-960473-35");
[09:15:30]  typescript: ...ox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/item-details/item-details.ts,       L38:  }
catch            line: 29  (e) {


            Supplied parameters do not match any signature of call target.

[09:15:30]  typescript: ...ox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/item-details/item-details.ts,       L26:
this.block2Items = [];
            line: 36       L27:
thi[09:15:30]  typescript: ...ox/Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/item-details/item-details.ts, s
.            line: 65 l
oadHomeItems([09:15:30]  typescript: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/letter-result/letter-result.ts,
);
            line: 31       L28:
this.trackEvent();

            Property 'analytics' does not exist on type 'Window'.

[09:15:30]  typescript: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/letter-result/letter-result.ts,       L33:
try            line: 38  {

      L34:      window.anal[09:15:30]  typescript: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/letter-result/letter-result.ts,
y            line: 72 t
ics.trackEvent("Home");
      L35:  } catch (e) {

            Cannot find name 'Response'.

      L68:  dataSuccess(res: Response) {
      L69:      this.loader.dismiss();

            Supplied parameters do not match any signature of call target.

[09:15:30]  typescript: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/search-result/search-result.ts,
      L28:              line: 26 this.itemDetails = null;

      L29:  [09:15:30]  typescript: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/search-result/search-result.ts, t
h            line: 33 i
[09:15:30]  typescript: .../Apps/TraduzindoSonhos/TraduzindoSonhos/src/pages/search-result/search-result.ts, s
.            line: 67 l
oadHomeItems();
      L30:  this.trackEvent();

            Property 'analytics' does not exist on type 'Window'.

      L35:  [09:15:30]  transpile failed
try {
      L36:      window.analytics.trackEvent("Details");
      L37:  } catch (e) {

            Cannot find name 'Response'.

      L65:  dataSuccess(res: Response) {
      L66:      this.loader.dismiss();

            Supplied parameters do not match any signature of call target.

      L30:  this.letter = this.letter.toUpperCase();
      L31:  this.loadHomeItems();
      L32:  this.trackEvent();

            Property 'analytics' does not exist on type 'Window'.

      L37:  try {
      L38:      window.analytics.trackEvent("LSearch", "Letter", this.letter);
      L39:  } catch (e) {

            Cannot find name 'Response'.

      L72:  dataSuccess(res: Response) {
      L73:      this.loadingItems = false;

            Supplied parameters do not match any signature of call target.

      L25:  this.letter = navParams.get('search');
      L26:  this.loadHomeItems();
      L27:  this.trackEvent();

            Property 'analytics' does not exist on type 'Window'.

      L32:  try {
      L33:      window.analytics.trackEvent("LSearch", "Letter", this.letter);
      L34:  } catch (e) {

            Cannot find name 'Response'.

      L67:  dataSuccess(res: Response) {
      L68:      this.loader.dismiss();

[09:15:30]  copy finished in 6.71 s
[09:15:30]  watch ready in 6.79 s
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

ionic $ q

您的系统信息:

科尔多瓦 CLI:6.3.1 Gulp 版本:CLI 版本 1.2.2 吞咽本地: 离子框架版本:2.0.0-rc.1 离子 CLI 版本:2.1.1 离子应用程序库版本:2.1.1 离子应用脚本版本:0.0.36 操作系统: 节点版本:v6.9.0

【问题讨论】:

  • 在运行ionic serve之前,您是否在项目的根目录中运行了npm install

标签: cordova ionic-framework ionic2


【解决方案1】:

据我了解,您缺少 cordova-plugin-google-analytics 插件。运行 ionic plugin add cordova-plugin-google-analytics添加它。

【讨论】:

    猜你喜欢
    • 2017-01-11
    • 2017-03-25
    • 1970-01-01
    • 1970-01-01
    • 2016-08-05
    • 2017-10-19
    • 2017-06-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多