我需要使用函数ReplaceAll((,所以我更新了文件tsconfig.json.
"lib": [
"es2018",
"ES2022.String",
"dom"
]
当我运行npm启动时,它显示错误:
错误TS6046:"--lib"选项的参数必须为:"es5"、"es6"、"es2015"、"ES 7"、"es2016"、"es 2017"、"埃斯2018"、"埃斯2019"、"e2020"、"下一个"、"dom"、"dom.iterable"、"webworker"、"webworker.importscripts"、"scripthost"、"es2015.core"、"est2015.collection"、"Est2015.generator"、"esc2015.iterable"、"es\2015.promise"、','es2015.symbol.wellknown',"es2016.array.include","es2017.object","es2017.sharedmemory","es2017.string","es2017.intl","es2018.asyncgenerator","es2018.asynciterable","es2018.intl"、"es2018.pronent"、"es2018.regexp"、"ES 2019.array"、"es 2019.object"、"es2019.string"、"埃斯2019.symbol"、"埃斯2020.bigint"、"es2020.promise"、",'esnext.array','snext.symbol',"esnext.asynciterable"、"esnext.intl"、"esnext.bigint".
看起来您使用的是不支持ES2022的旧版本TypeScript。例如,您需要使用以下命令更新TypeScript:npm install typescript@latest
。