由于某种未知的原因,新生成的 Angular 14.1 项目无法工作。看来 npm 我会下载损坏的库。删除node_modules不会有帮助..我现有项目中的文件(node_modules/@types/node/stream/web.d.ts)看起来不同..我无法在互联网上找到类似的东西...任何主意?谢谢!
Error: node_modules/@types/node/stream/web.d.ts:484:13 - error TS2502: 'ReadableByteStreamController' is referenced directly or indirectly in its own type annotation.
484 var ReadableByteStreamController: typeof globalThis extends
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@types/node/stream/web.d.ts:503:13 - error TS2502: 'ReadableStreamBYOBReader' is referenced directly or indirectly in its own type annotation.
503 var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
~~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@types/node/stream/web.d.ts:513:13 - error TS2502: 'ReadableStreamBYOBRequest' is referenced directly or indirectly in its own type annotation.
513 var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
~~~~~~~~~~~~~~~~~~~~~~~~~
尝试更改角度版本。当然,如果没有理由使用这么旧的版本,最好的解决方案是使用最新的稳定版本(~18.2.1)。