我阅读了一些文档,并在tsconfig.json中尝试了很多不同的操作,但是无论如何我仍然遇到这些错误。这是我的tsconfig.json的最简单的版本:
{
"compilerOptions": {
"rootDir": "./packages/"
},
"exclude": [
"node_modules",
"babel.config.js",
"webpack.config.js",
]
})
我所有的源代码都在/ packages中,并且那里只有源代码。奇怪的是,我得到的错误(以下)似乎与我的项目无关(程序包包含react-native源代码)。
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'.
感谢您的协助或见识!