Reactjs 未定义(未定义,未定义)中的TypeScript错误:找不到';组件发射器';

Reactjs 未定义(未定义,未定义)中的TypeScript错误:找不到';组件发射器';,reactjs,typescript,Reactjs,Typescript,在通过Microsoft定时更新更新Windows 10后(我不知道这是否相关,也可能是巧合),我在运行warn start时开始遇到这个问题 undefined TypeScript error in undefined(undefined,undefined): Cannot find type definition file for 'component-emitter'. The file is in the program because: Entry point for

在通过Microsoft定时更新更新Windows 10后(我不知道这是否相关,也可能是巧合),我在运行
warn start
时开始遇到这个问题

undefined
TypeScript error in undefined(undefined,undefined):
Cannot find type definition file for 'component-emitter'.
  The file is in the program because:
    Entry point for implicit type library 'component-emitter'  TS2688
Failed to compile.
我发现了类似的帖子,它通过删除package.json中名为@types/的包解决了这个问题。然而,我没有这样的一揽子计划

这是我的package.json文件:

{
“名称”:“web定位器”,
“版本”:“0.1.0”,
“私人”:没错,
“依赖项”:{
“@react hook/window size”:“^3.0.7”,
“@unform/core”:“^2.1.0”,
“@unform/web”:“^2.1.0”,
“axios”:“^0.19.2”,
“日期fns”:“^2.14.0”,
“抛光”:“^3.5.2”,
“反应”:“^16.13.1”,
“react dom”:“^16.13.1”,
“反应图标”:“^3.10.0”,
“反应图gl”:“^6.1.14”,
“反应路由器dom”:“^5.1.2”,
“反应脚本”:“3.4.0”,
“反应微调器”:“^0.9.0”,
“反应弹簧”:“^8.0.27”,
“样式化组件”:“^5.1.0”,
“类型脚本”:“^4.2.4”,
“uuidv4”:“^6.0.8”,
“是”:“^0.28.5”
},
“脚本”:{
“开始”:“反应脚本开始”,
“构建”:“反应脚本构建”,
“测试”:“反应脚本测试”,
“测试:覆盖率”:“反应脚本测试——覆盖率——watchAll false”,
“弹出”:“反应脚本弹出”
},
“eslintConfig”:{
“扩展”:“反应应用程序”
},
“笑话”:{
“CollectionCoverage from”:[
“src/pages/***.tsx”,
“src/components/***.tsx”,
“src/hooks/*.tsx”,
“!src/hooks/intex.tsx”
]
},
“浏览者”:{
“生产”:[
">0.2%",
“没有死”,
“不是全部”
],
“发展”:[
“上一个chrome版本”,
“上一个firefox版本”,
“最后1个safari版本”
]
},
“依赖性”:{
“@测试库/jest dom”:“^4.2.4”,
“@testing library/react”:“^9.3.2”,
“@testing library/react hooks”:“^3.3.0”,
“@测试库/用户事件”:“^7.1.2”,
“@types/jest”:“^24.0.0”,
“@types/node”:“^12.0.0”,
“@types/react”:“^16.9.0”,
“@types/react-dom”:“^16.9.0”,
“@types/react路由器dom”:“^5.1.5”,
“@types/react星级组件”:“^1.4.0”,
“@types/styled components”:“^5.1.0”,
“@types/yup”:“^0.28.0”,
“@typescript eslint/eslint插件”:“^2.29.0”,
“@typescript eslint/parser”:“^2.29.0”,
“axios模拟适配器”:“^1.18.1”,
“eslint”:“^6.8.0”,
“eslint配置airbnb”:“^18.1.0”,
“eslint配置美观”:“^6.11.0”,
“eslint导入解析程序类型脚本”:“^2.0.0”,
“eslint插件导入”:“^2.20.2”,
“eslint-plugin-jsx-a11y”:“^6.2.3”,
“eslint插件更漂亮”:“^3.1.3”,
“eslint插件反应”:“^7.19.0”,
“eslint插件反应挂钩”:“^2.5.1”,
“更漂亮”:“^2.0.5”
}
}
这是我的tsconfig.json文件:

{
“编译器选项”:{
“目标”:“es5”,
“lib”:[
“dom”,
“dom.iterable”,
“下一步”
],
“allowJs”:正确,
“skipLibCheck”:正确,
“esModuleInterop”:正确,
“allowSyntheticDefaultImports”:true,
“严格”:是的,
“ForceConsistentCasingFileNames”:true,
“模块”:“esnext”,
“moduleResolution”:“节点”,
“resolveJsonModule”:true,
“隔离模块”:正确,
“noEmit”:没错,
“jsx”:“反应”,
},
“包括”:[
“src”
],
“类型根”:[
“./node_modules/@types”,
“./@类型”
]
}

我以前收到过类似的警告,但现在我甚至不能再构建React应用程序了。这让我无法工作,所以我有点绝望。如果有人知道这可能是什么,请尽快告诉我。我将提供任何可能需要的额外信息。

更新:我通过运行
warn add@types/component emitter
解决了这个特殊问题,然后再次运行所有具有相同问题的包。这些包是
组件发射器
cookie
cors
。我不知道这是create react应用程序还是最新版本的Windows 10的问题,或者两者都有问题。但这是一个我并不认为已经解决的问题,因此可能会发生在其他人身上。