找不到模块' csstype'

时间:2018-04-06 22:20:58

标签: reactjs typescript

我是新手与打字稿的反应。我安装了反应,反应;然后安装@ types / react,@ types / react-dom,一切都很好,一切正常,除了我收到错误ERROR in [at-loader] ./node_modules/@types/react/index.d.ts:55:22 Cannot find module 'csstype'。所以我查看了此路径中的文件,并注意到vscode用红线标记了行 - import * as CSS from 'csstype';,并且标记为无法找到模块。我试过了yarn add csstypeyarn add csstype -D,却没有帮助。知道如何修复错误吗? [App适用于错误]。

1 个答案:

答案 0 :(得分:29)

使用compilerOptions.moduleResolution: "node"应该修复它