离子构建android的错误环境上下文中不允许使用初始化程序 [英] Error in ionic build android | Initializers are not allowed in ambient contexts

查看:577
本文介绍了离子构建android的错误环境上下文中不允许使用初始化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面的命令执行后得到以下错误 -

I'm getting below error, after below command execution -

 npm install ionic-angular@nightly --save

在系统完美运行之前,由于一些建议(谷歌地图不能在设备上工作),我做了更改并运行以上命令

Before system was working perfectly, due to some suggestion (google map was not working in device), I made changes and run above command

C:\Rakesh_Kumar_Jha\TisaBCodeScanApp>ionic build android

命令开始执行 -

> TISA@ ionic:build C:\Rakesh_Kumar_Jha\TisaBCodeScanApp
> ionic-app-scripts build

[18:49:57]  ionic-app-scripts 1.2.3
[18:49:57]  build dev started ...
[18:49:57]  clean started ...
[18:49:57]  clean finished in 1 ms
[18:49:57]  copy started ...
[18:49:57]  transpile started ...
[18:50:02]  typescript: ...ha/TisaBCodeScanApp/node_modules/ionic-angular/components/item/item-sliding.d.ts, line: 7

    Initializers are not allowed in ambient contexts.

[18:50:02]  typescript: ...isaBCodeScanApp/node_modules/ionic-angular/components/picker/picker-options.d.ts, line: 26        L6:
import { ItemOptions } from './item-options';
   L7:  export declare const ITEM_SIDE_FLAG_NONE [18:50:02]  typescript: ...isaBCodeScanApp/node_modules/ionic-angular/components/picker/picker-options.d.ts, line: 27 = 0;
  [18:50:02]  typescript: ...isaBCodeScanApp/node_modules/ionic-angular/components/picker/picker-options.d.ts, line: 29        L8:
export declare const ITEM_SIDE_FLAG_LEFT: number;

        Initializers are not allowed in ambient contexts.

[18:50:02]  typescript: ...ScanApp/node_modules/ionic-angular/components/virtual-scroll/virtual-scroll.d.ts, line: 220       L26:

export declare const PICKER_OPT_SELECTED [18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/gesture-controller.d.ts, line: 3 =  "picker-opt-selected";
[18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/gesture-controller.d.ts, line: 5       L27:
export declare const DECELERATION_FRICTION = 0.97;

        Initializers are not allowed in ambient contexts.

       L26:  [18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/gesture-controller.d.ts, line: 7 export declare const PICKER_OPT_SELECTED = "picker-opt-selected";

  L27:  [18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/gesture-controller.d.ts, line: 9 export declare const DECELERATION_FRICTION  = 0.97;
  L28:  export declare const FRAME_MS: number;

        Initializers are not allowed in ambient contexts.

      [18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-
 angular/gestures/gesture-controller.d.ts, line: 11       L28:
  export declare const FRAME_MS: number;
      [18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-
    angular/gestures/gesture-controller.d.ts, line: 13       L29:
    export declare const MAX_PICKER_SPEED [18:50:02]  typescript: 
   ...Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/gesture-
 controller.d.ts, line: 15 = 60;

        Type 'IterableDiffer' is not generic.

     [18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-
 angular/gestures/gesture-controller.d.ts, line: 17      L219:
  private _dom;
       [18:50:02]  typescript: ...Jha/TisaBCodeScanApp/node_modules/ionic-
  angular/gestures/gesture-controller.d.ts, line: 19      L220:
   _differ: [18:50:02]  typescript: 
    ...Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/gesture-
   controller.d.ts, line: 21 I
       [18:50:02]  typescript: 
   ...mar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/pointer-
   events.d.ts, line: 34 te
      [18:50:02]  typescript: 
  ...mar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/gestures/pointer-
   events.d.ts, line: 35 ra
       [18:50:02]  typescript: 
   ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-
  angular/navigation/nav-util.d.ts, line: 101 bl
     [18:50:02]  typescript: 
  ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/navigation/nav-
  util.d.ts, line: 102 e
     [18:50:02]  typescript: 
 ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/navigation/nav-
util.d.ts, line: 103 Di
    [18:50:02]  typescript: 
  ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/navigation/nav-
  util.d.ts, line: 104 f
  [18:50:02]  typescript: 
 ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/navigation/nav-
 util.d.ts, line: 105 e
 r<any>;
  L221:  [18:50:02]  typescript: 
  ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/navigation/nav-
 util.d.ts, line: 106 _scrollSub: any;

        Initializers are not allowed in ambient contexts.


   L2:  /** @hidden */
 [18:50:02]  typescript: ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-
  angular/navigation/nav-util.d.ts, line: 107
        L3:  [18:50:02]  typescript: 
 ...h_Kumar_Jha/TisaBCodeScanApp/node_modules/ionic-angular/navigation/nav-
  util.d.ts, line: 108 export declare const GESTURE_GO_BACK_SWIPE =
  "goback-swipe";

   L4:  /** @hidden */

        Initializers are not allowed in ambient contexts.

   L4:  /** @hidden */
   L5:  export declare const GESTURE_MENU_SWIPE = "menu-swipe";
   L6:  /** @hidden */

        Initializers are not allowed in ambient contexts.

   L6:  [18:50:02]  ionic-app-script task: "build" /** @hidden */

   L7:  export declare const GESTURE_ITEM_SWIPE [18:50:02]  Error: Failed to 
transpile program = "item-swipe";
Error: Failed to transpile program
    at BuildError.Error (native)
    at new BuildError 

 (C:\Rakesh_Kumar_Jha\TisaBCodeScanApp\node_modules\@ionic\app-
 scripts\dist\util\errors.js:16:28)
     at C:\Rakesh_Kumar_Jha\TisaBCodeScanApp\node_modules\@ionic\app-
  scripts\dist\transpile.js:102:20 at transpileWorker 
 (C:\Rakesh_Kumar_Jha\TisaBCodeScanApp\node_modules\@ionic\app-
 scripts\dist\transpile.js:68:12) at Object.transpile 

(C:\Rakesh_Kumar_Jha\TisaBCodeScanApp\node_modules\@ionic\app-
 scripts\dist\transpile.js:26:12) at buildProject 
 (C:\Rakesh_Kumar_Jha\TisaBCodeScanApp\node_modules\@ionic\app-
 scripts\dist\build.js:98:78)
     at C:\Rakesh_Kumar_Jha\TisaBCodeScanApp\node_modules\@ionic\app-
  scripts\dist\build.js:46:16       L8:

  /** @hidden */

        Initializers are not allowed in ambient contexts.

   L8:  /** @hidden */
   L9:  export declare const GESTURE_REFRESHER = "refresher";
  L10:  /** @hidden */

        Initializers are not allowed in ambient contexts.

  L10:  /** @hidden */
  L11:  export declare const GESTURE_TOGGLE = "toggle";
  L12:  /** @hidden */

        Initializers are not allowed in ambient contexts.


  L12:  /** @hidden */
  L13:  export declare const GESTURE_PRIORITY_SLIDING_ITEM =npm -10;
  L14:   /** @hidden */

        Initializers are not allowed in ambient contexts.

  L14:  ERR!/** @hidden */
  L15:  export declare const GESTURE_PRIORITY_REFRESHER  Windows_NT 
 10.0.10586 = 0;

  L16:  npm/** @hidden */

        Initializers are not allowed in ambient contexts.

   L16:  /** @hidden */
ERR!      L17:   export declare const GESTURE_PRIORITY_MENU_SWIPE argv= 10;
 "C:\\Program Files\\nodejs\\node.exe" "C:\\Program 
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:build" "--"
  L18:  /** @hidden */

        Initializers are not allowed in ambient contexts.

npm      L18:   /** @hidden */
ERR!      L19:  export declare const GESTURE_PRIORITY_GO_BACK_SWIPE  = 20;
node      L20:   v6.10.1

/** @hidden */

        Initializers are not allowed in ambient contexts.

  L20:  /** @hidden */
 npm      L21:  export declare const GESTURE_PRIORITY_TOGGLE  =ERR! 30;

        Initializers are not allowed in ambient contexts.

   L34:  export declare const POINTER_EVENT_TYPE_MOUSE npm = 1;
 v3.10.10
  L35:  export declare const POINTER_EVENT_TYPE_TOUCH = 2;

        Initializers are not allowed in ambient contexts.

  L34:  npmexport declare const POINTER_EVENT_TYPE_MOUSE = 1;
   L35:  export declare const POINTER_EVENT_TYPE_TOUCH ERR!= 2;
   L36:  export interface PointerEventsConfig {

        Initializers are not allowed in ambient contexts.

     L101:  codeexport declare const STATE_NEW  ELIFECYCLE
 =npm 1;
      L102:  export declare const STATE_INITIALIZED = 2;

        Initializers are not allowed in ambient contexts.

ERR!     L101:  export declare const STATE_NEW = 1;
 TISA@ ionic:build: `ionic-app-scripts build`
 L102:  npmexport declare const STATE_INITIALIZED =  2;
 L103:  ERR!export declare const STATE_ATTACHED = 3;

        Initializers are not allowed in ambient contexts.

 L102:  export declare const STATE_INITIALIZED = 2;

 Exit status 1

 L103:  export declare const STATE_ATTACHED npm= 3;
  L104:  export declare const STATE_DESTROYED = 4;

        Initializers are not allowed in ambient contexts.

ERR!     L103:  export declare const STATE_ATTACHED = 3;
 L104:
export declare const STATE_DESTROYED = 4;
 L105:  npmexport declare const INIT_ZINDEX = 100;

        Initializers are not allowed in ambient contexts.

 L104:   export declare const STATE_DESTROYED = 4;
 L105:  ERR!export declare const INIT_ZINDEX = 100;
 Failed at the TISA@ ionic:build script 'ionic-app-scripts build'.
     L106:  export declare const DIRECTION_BACK = "back";

        Initializers are not allowed in ambient contexts.

npm     L105:  export declare const INIT_ZINDEX = 100;
  L106:  export declare const DIRECTION_BACK ERR!= "back";
 L107:  export declare const DIRECTION_FORWARD = "forward";

        Initializers are not allowed in ambient contexts.

 Make sure you have the latest version of node.js and npm installed.
         L106:  export declare const DIRECTION_BACK = "back";
npm         L107:  export declare const DIRECTION_FORWARD  = "forward";
 ERR!     L108:  export declare const DIRECTION_SWITCH = "switch";

        Initializers are not allowed in ambient contexts.

 L107:  export declare const DIRECTION_FORWARD = "forward";
  If you do, this is most likely a problem with the TISA package,
     L108:  export declare const DIRECTION_SWITCH =npm "switch";

 ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR!     ionic-app-scripts build
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR!     npm bugs TISA
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR!     npm owner ls TISA
 npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Rakesh_Kumar_Jha\TisaBCodeScanApp\npm-debug.log

C:\Rakesh_Kumar_Jha\TisaBCodeScanApp>


推荐答案

尝试使用此命令更新您的TS编译器版本你的控制台:

Try updating your version of TS Compiler applying this command in your console:

npm install --save typescript@latest

继续摇摆!

这篇关于离子构建android的错误环境上下文中不允许使用初始化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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