Javascript 错误:无法调用其类型缺少调用签名的表达式。类型';没有兼容的c ll签名
我尝试在angular项目中使用,当我尝试运行ng server时,构建失败,出现以下错误Javascript 错误:无法调用其类型缺少调用签名的表达式。类型';没有兼容的c ll签名,javascript,angular,typescript,Javascript,Angular,Typescript,我尝试在angular项目中使用,当我尝试运行ng server时,构建失败,出现以下错误 error TS2349: Cannot invoke an expres ion whose type lacks a call signature. Type node_modules/@types/polylabel/index"'has no compatible c ll signatures. 以下是index.ts的代码 // Type definitions for polyla
error TS2349: Cannot invoke an expres ion whose type lacks a call signature. Type node_modules/@types/polylabel/index"'has no compatible c ll signatures.
以下是index.ts的代码
// Type definitions for polylabel 1.0
// Project: https://github.com/mapbox/polylabel
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Polylabel returns the pole of inaccessibility coordinate in [x, y] format.
*
* @param polygon - Given polygon coordinates in GeoJSON-like format
* @param precision - Precision (1.0 by default)
* @param debug - Debugging for Console
* @example
* var p = polylabel(polygon, 1.0);
*/
declare function polylabel(polygon: number[][][], precision?: number, debug?: boolean): number[];
declare namespace polylabel {}
export default polylabel;
//多段标签1.0的类型定义
//项目:https://github.com/mapbox/polylabel
//定义:Denis Carriere
//定义:https://github.com/DefinitelyTyped/DefinitelyTyped
/**
*Polylabel以[x,y]格式返回不可访问坐标的极点。
*
*@param polygon-类似GeoJSON格式的给定多边形坐标
*@param precision-精度(默认为1.0)
*@param debug-控制台调试
*@example
*var p=多段标签(多边形,1.0);
*/
声明函数polylabel(多边形:编号[],精度?:编号,调试?:布尔):编号[];
声明命名空间多段标签{}
导出默认多段标签;
显然,我没有在全球安装polylabel。执行npm安装polylabel
修复了该问题。显然,我没有全局安装polylabel。执行npm安装polylabel
修复了该问题