【发布时间】:2026-01-08 08:05:02
【问题描述】:
这是我的 tsconfig.json 文件:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es6",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
当我将 lib 和目标版本更改为 es2020 时,出现以下错误:
tsconfig.json(13,15):错误 TS6046:“--target”选项的参数必须是:“es3”、“es5”、“es6”、“es2015”、“es2016”、“es2017”、 'es2018','esnext'。
【问题讨论】:
-
我的回答解决了你的问题吗?
-
是的。感谢您的帮助
-
没问题,很高兴能帮上忙 :)
标签: angular typescript ecmascript-next ecmascript-2020