在尝试从Angular 12升级到Angular 13时,@types/ws 中出现错误。

huangapple go评论55阅读模式
英文:

ERROR in @types/ws trying to update from angular 12 to angular 13

问题

我已将我的项目从Angular 12升级到Angular 13,但我遇到了这个错误:

错误:node_modules/@types/ws/index.d.ts:328:18 - 错误 TS2315:类型 'Server' 不是泛型。

328 server?: HTTPServer<V> | HTTPSServer<V> | undefined;


错误:node_modules/@types/ws/index.d.ts:328:34 - 错误 TS2315:类型 'Server' 不是泛型。

328 server?: HTTPServer&lt;V&gt; | HTTPSServer&lt;V&gt; | undefined;

我尝试安装npm i @types/ws但没有成功。

英文:

I have updated my project from angular 12 to angular 13 and I'm facing this error:

Error: node_modules/@types/ws/index.d.ts:328:18 - error TS2315: Type &#39;Server&#39; is not generic.

328         server?: HTTPServer&lt;V&gt; | HTTPSServer&lt;V&gt; | undefined;
                     ~~~~~~~~~~~~~


Error: node_modules/@types/ws/index.d.ts:328:34 - error TS2315: Type &#39;Server&#39; is not generic.

328         server?: HTTPServer&lt;V&gt; | HTTPSServer&lt;V&gt; | undefined;
                                     ~~~~~~~~~~~~~~

I tried installing npm i @types/ws with no success.

答案1

得分: 21

Solution: 使用npm安装 -f @types/ws@8.5.4

英文:

Solution: npm install -f @types/ws@8.5.4

huangapple
  • 本文由 发表于 2023年6月12日 19:07:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76456053.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定