file typescript/lib/lib.d.ts not found. The file is in the program because Default library for target ‘es3’
problem
jsconfig.json 红线,vscode 提示错误信息
file typescript/lib/lib.d.ts not found. The file is in the program because Default library for target ‘es3’
reason
缺少lib包
solution
配置选项添加:“lib”: [“ESNext”, “DOM”]
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
},
"lib": ["ESNext", "DOM"]
},
"exclude": ["node_modules", "dist"]
}
本文讲述了在TypeScript项目中遇到的'lib.d.ts not found'错误,由于默认库不适用于ES3目标。解决方法是通过修改jsconfig.json文件,添加'lib'配置为['ESNext', 'DOM'],确保项目兼容性和正确编译。

3582

被折叠的 条评论
为什么被折叠?



