Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic2 Ionic项目类型脚本错误_Ionic2_Typescript Typings - Fatal编程技术网

Ionic2 Ionic项目类型脚本错误

Ionic2 Ionic项目类型脚本错误,ionic2,typescript-typings,Ionic2,Typescript Typings,我刚刚安装了ionic、cordova,并创建了一个空项目。 每次启动ionic serve时,它都会显示带有以下类型脚本错误的浏览器页面: **Typescript Error** All declarations of 'size' must have identical modifiers. node_modules/typescript/lib/lib.es2015.collection.d.ts get(key: K): V | undefined; has(key: K): boo

我刚刚安装了ionic、cordova,并创建了一个空项目。 每次启动ionic serve时,它都会显示带有以下类型脚本错误的浏览器页面:

**Typescript Error**

All declarations of 'size' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.collection.d.ts
get(key: K): V | undefined;
has(key: K): boolean;
set(key: K, value: V): this;
Typescript Error
All declarations of 'prototype' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.collection.d.ts
new (): WeakMap<object, any>;
new <K extends object, V>(entries?: [K, V][]): WeakMap<K, V>;
readonly prototype: WeakMap<object, any>;
本地套餐:

@ionic/cli-utils : 1.4.0
Ionic CLI        : 3.4.0
@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-ionic-angular : 1.3.1
Ionic Framework                 : ionic-angular 3.5.0
Node       : v7.2.0
OS         : OS X El Capitan
Xcode      : Xcode 8.2.1 Build version 8C1002 
ios-deploy : not installed
ios-sim    : not installed
npm        : 4.1.1 
系统:

@ionic/cli-utils : 1.4.0
Ionic CLI        : 3.4.0
@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-ionic-angular : 1.3.1
Ionic Framework                 : ionic-angular 3.5.0
Node       : v7.2.0
OS         : OS X El Capitan
Xcode      : Xcode 8.2.1 Build version 8C1002 
ios-deploy : not installed
ios-sim    : not installed
npm        : 4.1.1 

不确定这是否是正确的解决方案,我所做的是在tsconfig.json中 我将类型设置为空数组:

"compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5",
    "types": []
这家伙还建议安装typings-lodash(npm-install@types/lodash--save-dev--save-exact)


然后我设置了“类型”:[“lodash”],这也是可行的。如果有更好的解决方案,请给出任何意见。因为在我的另一个项目中,它没有解决所有问题,不确定它是否是一个项目问题,或者仍然是由于typescript

你的typescript版本是什么?