Typescript 编译器突然开始生成错误

2024-04-05

我正在开发一个 Angular 2 项目,当我尝试运行打字稿编译器时,突然开始出现很多很多错误。有人可以建议从哪里开始搜索吗?我没有故意更改任何基本内容,即使当我从存储库克隆一个新副本时,错误仍然存​​在。错误如下:

node_modules/@types/node/index.d.ts(102,6): error TS2300: Duplicate identifier 'BufferEncoding'.
node_modules/@types/node/index.d.ts(256,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'errno' must be of type 'number', but here has type 'string'.
node_modules/@types/node/index.d.ts(263,18): error TS2300: Duplicate identifier 'EventEmitter'.
node_modules/@types/node/index.d.ts(549,26): error TS2300: Duplicate identifier 'Buffer'.
node_modules/@types/node/index.d.ts(549,50): error TS2300: Duplicate identifier 'SlowBuffer'.
node_modules/@types/node/index.d.ts(570,18): error TS2300: Duplicate identifier 'EventEmitter'.
node_modules/@types/node/index.d.ts(570,18): error TS2415: Class 'EventEmitter' incorrectly extends base class 'NodeJS.EventEmitter'.
  Types of property 'eventNames' are incompatible.
    Type '() => (string | symbol)[]' is not assignable to type '() => string[]'.
      Type '(string | symbol)[]' is not assignable to type 'string[]'.
        Type 'string | symbol' is not assignable to type 'string'.
          Type 'symbol' is not assignable to type 'string'.
node_modules/@types/node/index.d.ts(733,18): error TS2300: Duplicate identifier 'Agent'.
node_modules/@types/node/index.d.ts(788,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'addressType' must be of type 'string', but here has type 'number | "udp4" | "udp6"'.
node_modules/@types/node/index.d.ts(791,18): error TS2300: Duplicate identifier 'Worker'.
node_modules/@types/node/index.d.ts(1377,17): error TS2300: Duplicate identifier 'CompleterResult'.
node_modules/@types/node/index.d.ts(1414,18): error TS2300: Duplicate identifier 'Script'.
node_modules/@types/node/index.d.ts(2550,18): error TS2300: Duplicate identifier 'TLSSocket'.
node_modules/@types/node/index.d.ts(2684,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'pfx' must be of type 'any', but here has type 'string | Buffer[]'.
node_modules/@types/node/index.d.ts(2685,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'key' must be of type 'any', but here has type 'string | any[] | string[] | Buffer'.
node_modules/@types/node/index.d.ts(2687,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'cert' must be of type 'any', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(2688,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'ca' must be of type 'any', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(2689,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'crl' must be of type 'any', but here has type 'string | string[]'.
node_modules/@types/node/index.d.ts(2691,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'honorCipherOrder' must be of type 'any', but here has type 'boolean'.
node_modules/@types/node/index.d.ts(2694,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'NPNProtocols' must be of type 'any', but here has type 'string[] | Buffer'.
node_modules/@types/node/index.d.ts(2711,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'key' must be of type 'string | Buffer', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(2713,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'cert' must be of type 'string | Buffer', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(2714,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'ca' must be of type '(string | Buffer)[]', but here has type 'string | Buffer | (string | Buffer)[]'.
node_modules/@types/node/index.d.ts(2953,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'padding' must be of type 'any', but here has type 'number'.
node_modules/@types/node/index.d.ts(2958,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'padding' must be of type 'any', but here has type 'number'.
node_modules/@types/node/index.d.ts(3216,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
node_modules/@types/node/index.d.ts(3299,5): error TS2300: Duplicate identifier 'export='.
node_modules/@types/node/index.d.ts(3321,18): error TS2300: Duplicate identifier 'Domain'.
node_modules/@types/node/index.d.ts(3613,5): error TS2300: Duplicate identifier 'export='.
typings/globals/node/index.d.ts(78,6): error TS2300: Duplicate identifier 'BufferEncoding'.
typings/globals/node/index.d.ts(234,18): error TS2300: Duplicate identifier 'EventEmitter'.
typings/globals/node/index.d.ts(516,9): error TS2502: 'BuffType' is referenced directly or indirectly in its own type annotation.
typings/globals/node/index.d.ts(517,9): error TS2502: 'SlowBuffType' is referenced directly or indirectly in its own type annotation.
typings/globals/node/index.d.ts(518,26): error TS2300: Duplicate identifier 'Buffer'.
typings/globals/node/index.d.ts(518,50): error TS2300: Duplicate identifier 'SlowBuffer'.
typings/globals/node/index.d.ts(539,18): error TS2300: Duplicate identifier 'EventEmitter'.
typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'addListener' of types 'EventEmitter' and 'Server' are not identical.
typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'emit' of types 'EventEmitter' and 'Server' are not identical.
typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'on' of types 'EventEmitter' and 'Server' are not identical.
typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'once' of types 'EventEmitter' and 'Server' are not identical.
typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'prependListener' of types 'EventEmitter' and 'Server' are not identical.
typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Server' are not identical.
typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'removeListener' of types 'EventEmitter' and 'Server' are not identical.
typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'addListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'emit' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'on' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'once' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'removeListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'addListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'emit' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'on' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'once' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'removeListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'addListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'emit' of types 'EventEmitter' and 'Readable' are not identical.
typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'on' of types 'EventEmitter' and 'Readable' are not identical.
typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'once' of types 'EventEmitter' and 'Readable' are not identical.
typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'prependListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'removeListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/globals/node/index.d.ts(698,18): error TS2300: Duplicate identifier 'Agent'.
typings/globals/node/index.d.ts(743,18): error TS2300: Duplicate identifier 'Worker'.
typings/globals/node/index.d.ts(1004,22): error TS2300: Duplicate identifier 'CompleterResult'.
typings/globals/node/index.d.ts(1044,18): error TS2300: Duplicate identifier 'Script'.
typings/globals/node/index.d.ts(1886,18): error TS2300: Duplicate identifier 'TLSSocket'.
typings/globals/node/index.d.ts(2343,5): error TS2300: Duplicate identifier 'export='.
typings/globals/node/index.d.ts(2365,18): error TS2300: Duplicate identifier 'Domain'.
typings/globals/node/index.d.ts(2625,5): error TS2300: Duplicate identifier 'export='.

看起来您在两个地方都有节点类型。

node_modules/@types/node/index.d.ts

打字/全局/节点/index.d.ts

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Typescript 编译器突然开始生成错误 的相关文章

随机推荐

  • MKMapViewDelegate:如何识别 rendererForOverlay 中的覆盖

    我添加两个不同的MKGeodesicPolyline实例到MKMapView像这样 CLLocation LAX CLLocation alloc CLLocation JFK CLLocation alloc CLLocation LHR
  • 调用批处理脚本而不使用 CALL 或 START

    当我从批处理脚本调用批处理脚本而没有CALL or START 例子 我有两个脚本 a bat 和 b bat a bat echo I am A gt gt log b bat echo end of A gt gt log b bat
  • 如何备份本地Git仓库?

    我在一个相对较小的项目上使用 git 我发现压缩 git 目录的内容可能是备份项目的好方法 但这有点奇怪 因为当我恢复时 我需要做的第一件事是git reset hard 以这种方式备份 git 存储库有任何问题吗 另外 有没有更好的方法来
  • JSF 2.2 - 文件上传不适用于 Ajax。表单的 enctype 似乎不正确(仅通过 AJAX)

    尝试实现 JSF 2 2 示例 我有以下代码
  • Java中有二进制文字吗?

    我想用二进制文字来声明我的整数 在Java中可以吗 在 JDK 7 中可以 int binaryInt 0b101 只需在您的号码前添加前缀即可0b
  • HornetQ 重启后不会保留消息

    我使用 HornetQ 作为队列提供程序 因为它具有持久性功能 但是 在我重新启动应用程序后 队列中的所有消息都会丢失 也许是配置问题 这是代码 Step 1 Create the Configuration and set the pro
  • Excel VBA 禁用快捷键有时会禁用数据输入

    为什么我的代码会随机偶尔禁用数据输入 但即使我隔离它并删除所有其他宏 大多数时间仍然可以工作 该代码禁用了几乎所有快捷键 但不应影响简单的数据输入 Option Explicit Rem mod ShortCutKeys Ctrl Alt
  • WebGet 的 WCF 响应格式

    WCF 为 ServiceContract 中的 WebGet 注释中的 ResponseFormat 属性提供了两个选项 ServiceContract public interface IService1 OperationContra
  • Drupal 6:打印纯正的主链接和所有子链接

    世界上怎么可能 我发誓 我读了相当于三本百科全书的书 却毫无用处 我已经尝试过区域 page tpl php 和块内的解决方案 他们都没有给我我需要的东西 而且我知道还有很多其他人也需要这个 我得出的结论是 我想打印出 page tpl p
  • 模糊除 div 之外的整个页面

    我有以下代码 除了中心的红色 div 之外 我需要将所有内容都模糊化 我尝试使用filter none or filter blur 0 但这行不通 如何模糊背景中除红色 div 之外的所有内容 编辑 我也尝试将它与 z index 一起使
  • iOS 11:蜂窝信号强度

    我正在获取蜂窝信号强度 iOS let statusBarView UIApplication shared value forKey statusBar as UIView if let foregroundView statusBarV
  • Spark:当我在 Range 中使用累加器时,它无法正常工作

    我不明白为什么 Spark 没有正确更新我的累加器 object AccumulatorsExample extends App val acc sc accumulator 0L acc sc range 0 20000 step 25
  • 在 C++17 中使用 const std::string& 参数是否有意义?

    通过得到string view在 C 17 中 我们得到了传递两者的廉价方法std string and char 不拥有字符串所有权并避免制作临时副本的函数 通过使用std string按值传递和std move我们可以显式且快速地传递右
  • 指定 NVCC 用于编译主机代码的编译器

    运行 nvcc 时 它始终使用 Visual C 编译器 cl exe 我怎样才能让它使用GCC编译器 设置CC环境变量到gcc没有修复它 我在可执行文件帮助输出中也找不到任何选项 在 Windows 上 NVCC 仅支持 Visual C
  • 为什么某些基本类型在 TypeScript 中不能传递赋值——它们是否按预期运行?

    本来想在 TypeScript 存储库的问题跟踪器中打开一个错误报告 我意识到我问了太多问题 所以我在错误报告之前在这里打开一个问题 带有相关代码的 Playground 链接 https www typescriptlang org pl
  • SecurityException - GoogleCertificatesRslt:不允许

    我们有一个拥有数百万用户的应用程序 在过去的一周里 我们从 Firebase Crashlytics 的旧版本应用程序中收到了大约 30 个 速度警报 其中包含如下错误消息 Fatal Exception java lang Securit
  • 使用按钮在打印机中打印 jLabel 的图标[关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我有一个带有图标的 jLabel 我想使用按钮在打印机 佳能 惠普 爱普生任何打印机 中打印该图标 我怎样才能做到这一点 有什么有用的代码
  • 在 MS Access 上与多个程序员一起工作

    您是否建议与多个程序员一起开发 MS Access 应用程序 我们的一款 MS Access 应用程序已经发展到了这样的程度 一名程序员无法在要求的时间范围内处理大量的更改 错误修复 和新功能 我们正在尝试使用 VBA 中未记录的 Save
  • 如何缩小自定义 Skobbler 离线地图应用程序的大小

    我正在将 Skobbler 地图集成到我的 iOS 应用程序中 目前 该应用程序的大小为 160Mb 这太大了 但我注意到已经集成了一堆地图 我想删除所有地图并让用户下载他需要的地图 现在 当我包含 SKMaps framework 时 其
  • Typescript 编译器突然开始生成错误

    我正在开发一个 Angular 2 项目 当我尝试运行打字稿编译器时 突然开始出现很多很多错误 有人可以建议从哪里开始搜索吗 我没有故意更改任何基本内容 即使当我从存储库克隆一个新副本时 错误仍然存 在 错误如下 node modules