当我试图编译我的离子ts代码时,我遇到了一个问题。
在编译transpile部分的代码时,它失败了,因为
02:17:56打字稿:...project/node_modules/@types/geojson/index.d.ts,行: 142 ',‘预期’。
L141: id?: string | number;
L143: * Properties associated with this feature.02:17:56打字稿:...project/node_modules/@types/geojson/index.d.ts,行: 163 ',‘预期’。
02:17:56打字稿:...project/node_modules/@types/geojson/index.d.ts,行:164个通用类型的“功能”需要3个类型的参数。
02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 605通用类型的“功能”需要3种类型的参数。
nds InternalPolyline {
L606: constructor(latlngs: LatLngExpression[], options?: PolylineOptions);02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 607通用类型的“功能”需要3种类型的参数。
L606: constructor(latlngs: LatLngExpression[], options?: PolylineOptions);
L607: toGeoJSON(): GeoJSONFeature<GeoJSONPolygon | GeoJSONMultiPolygon>;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 614通用类型的“功能”需要3种类型的参数。
ends Polygon {
L615: constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions);02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 616通用类型的“功能”需要3种类型的参数。
L615: constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions);
16: setBounds(latLngBounds: LatLngBoundsExpression): this;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 634个通用类型的“功能”需要3个类型的参数。
L633: options: CircleMarkerOptions;
L634: feature?: GeoJSONFeature<GeoJSONPoint>;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 641个通用类型的“功能”需要3种类型的参数。
L640: constructor(latlng: LatLngExpression, options?: CircleMarkerOptions);
L641: constructor(latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions); // deprecated!
L642: getBounds(): LatLngBounds;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 689通用类型'FeatureCollection‘需要3种类型的参数。
L690: * Removes the layer with the given internal ID or the given layer from the group.02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 689通用类型的“功能”需要3种类型的参数。
L690: * Removes the layer with the given internal ID or the given layer from the group.02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 743通用类型'FeatureCollection‘需要3个类型参数。
L742: function layerGroup(layers: Layer[]): LayerGroup;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 743通用类型的“功能”需要3种类型的参数。
L742: function layerGroup(layers: Layer[]): LayerGroup;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 783通用类型的“功能”需要3种类型的参数。
L782: * feature and its LatLng.
L784: * The default is to spawn a default Marker:02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 799通用类型的“功能”需要3种类型的参数。
L798: * The default value is to not override any defaults:
L800: * ```02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 825通用类型的“功能”需要3种类型的参数。
L826: * function (geoJsonFeature) {02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 838通用类型的“功能”需要3种类型的参数。
L837: coordsToLatLng?(coords: [number, number] | [number, number, number]): LatLng; // check if LatLng has an altitude property02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 856通用类型的“功能”需要3种类型的参数。
L855: static coordsToLatLng(coords: [number, number] | [number, number, number]): LatLng;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 890通用类型的“功能”需要3种类型的参数。
L889: addData(data: GeoJSONGeoJsonObject): Layer;02:17:56打字稿:...project/node_modules/@types/leaflet/index.d.ts,行: 890通用类型的“功能”需要3种类型的参数。
L889: addData(data: GeoJSONGeoJsonObject): Layer;错误:在新的(project\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28) project\node_modules\@ionic\app-scripts\dist\transpile.js:137:20 at transpileWorker (project\node_modules\@ionic\app-scripts\dist\transpile.js:103:12) at Object.transpile上的BuildError.Error (本机)传输程序失败(project\node_(project\node_modules\@ionic\app-scripts\dist\transpile.js:103:12)\@离子型\app-script\dist)( (project\node_modules\@ionic\app-scripts\dist\build.js:97:78) at project\node_modules\@ionic\app-scripts\dist\build.js:47:16的buildProject \transpile.js:61:12)
有人知道怎么解决这个问题吗?
发布于 2018-01-01 09:59:01
问题是在package.json中"@types/leaflet": "1.5.9"包含了较新版本的"@types/geojson",
因此,我只需要自己包含"@types/geojson",并设置一个特定的版本,如:"@types/geojson": "1.0.5"。
https://stackoverflow.com/questions/48000216
复制相似问题