Typescript 为什么tsc(打字脚本)会给我错误;找不到xyz的类型定义文件;?
我读了一些文档,在tsconfig.json中尝试了很多不同的东西,但不管怎样,我仍然会遇到这些错误。以下是我的tsconfig.json的最简单版本:Typescript 为什么tsc(打字脚本)会给我错误;找不到xyz的类型定义文件;?,typescript,tsc,Typescript,Tsc,我读了一些文档,在tsconfig.json中尝试了很多不同的东西,但不管怎样,我仍然会遇到这些错误。以下是我的tsconfig.json的最简单版本: { "compilerOptions": { "rootDir": "./packages/" }, "exclude": [ "node_modules", "babel.config.js", "webpack.config.js", ] }) 我所有的源代码都在/packages中,那里只
{
"compilerOptions": {
"rootDir": "./packages/"
},
"exclude": [
"node_modules",
"babel.config.js",
"webpack.config.js",
]
})
我所有的源代码都在/packages中,那里只有源代码。奇怪的是,我得到的错误(如下)似乎与我的项目无关(包中包含react本机源代码)
感谢您的帮助或见解
error TS2688: Cannot find type definition file for 'anymatch'.
error TS2688: Cannot find type definition file for 'body-parser'.
error TS2688: Cannot find type definition file for 'connect'.
error TS2688: Cannot find type definition file for 'connect-history-api-fallback'.
error TS2688: Cannot find type definition file for 'express'.
error TS2688: Cannot find type definition file for 'express-serve-static-core'.
error TS2688: Cannot find type definition file for 'http-proxy'.
error TS2688: Cannot find type definition file for 'http-proxy-middleware'.
error TS2688: Cannot find type definition file for 'mime'.
error TS2688: Cannot find type definition file for 'range-parser'.
error TS2688: Cannot find type definition file for 'serve-static'.
error TS2688: Cannot find type definition file for 'source-list-map'.
error TS2688: Cannot find type definition file for 'uglify-js'.
error TS2688: Cannot find type definition file for 'webpack'.
error TS2688: Cannot find type definition file for 'webpack-dev-server'.
error TS2688: Cannot find type definition file for 'webpack-sources'.