https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d0df8af318e457abf9a8f193f310b53e2feefb70/types/koa/index.d.ts#L28
你确定这里是正确的导入吗?
我通过改变它解决了这个问题
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d0df8af318e457abf9a8f193f310b53e2feefb70/types/koa/index.d.ts#L104
只是
网址:网址;
将@types/node更新到最新版本为我解决了这个问题
@types/node
我将URL: url.URL;更改URL: url.Url; 。 并解决了。
URL: url.URL;
URL: url.Url;
实际上,您需要做的就是将@type/node到 tsconfig compilerOptions ```json { “编译器选项”:{ “类型”:[ “节点” ] } }
@type/node
最有用的评论
将
@types/node
更新到最新版本为我解决了这个问题