【发布时间】:2021-10-28 18:40:45
【问题描述】:
这是我的打字稿配置
$ npx tsc --showConfig
{
"compilerOptions": {
"target": "es2021",
"lib": [],
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
},
"files": [
"./index.ts", ]
}
这是我的index.ts:
const a = 1n;
当我尝试运行 tsc 时,我得到了这个输出
$ npx tsc index.ts
error TS2737: BigInt literals are not available when targeting lower than ES2020.
为什么会出现此错误?我的 tsconfig 文件有什么问题吗?
【问题讨论】:
-
您使用的是什么打字稿版本?它可能不知道 ES2021。
标签: typescript tsconfig bigint