较旧版本的@types会导致问题

时间:2018-02-16 17:11:30

标签: typescript npm types typescript-typings

一段时间以来,我经历过我的React项目突然无法构建

如果删除node_modules文件夹和锁定文件,则会出现问题。在运行npm install之后,我运行了一个npm构建,然后它无法编译。

例如,我收到此错误:

ERROR in [at-loader] ./node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:3782:13
TS2717: Subsequent property declarations must have the same type.  Property 'dialog' must be of type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>', but here has type 'DetailedHTMLProps<DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>'.

我在devDependencies下的package.json中使用@ types / react&#34;:&#34; 16.0.36。更新到@ types / react&#34;:&#34; 16.0.38这次解决了问题。

我不明白的是,为什么这个软件包在工作时会突然出现问题&#34;昨天&#34;。这只是许多软件包中的一个(@types)突然导致我的应用程序无法构建。

在我的tsconfig.json中,我甚至添加了node_modules作为排除,但这似乎没有任何影响。

任何人都能解释为什么这种情况一直发生在我身上吗?

0 个答案:

没有答案
相关问题