[英]tsconfig error when setting module to ES2017
Following documentation for LitElement my tsconfig.json looks like this: 在LitElement的以下文档中,我的tsconfig.json如下所示:
{
"compilerOptions": {
"target": "ES2017",
"module": "ES2017",
"moduleResolution": "node",
"experimentalDecorators": true
},
"include": [
"src/*"
]
}
I see an error saying 我看到一个错误说
TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'. TS6046:“-module”选项的参数必须为:“ none”,“ commonjs”,“ amd”,“ system”,“ umd”,“ es6”,“ es2015”,“ esnext”。
Can you please try adding the "lib" array to your compiler options as shown below?. 您可以尝试将“ lib”数组添加到编译器选项中,如下所示吗? Also change all occurences of es from ES to es 还将es的所有出现从ES更改为es
{
"compilerOptions": {
"target": "es2017",
"module": "es2017",
"moduleResolution": "node",
"experimentalDecorators": true,
"lib": [
"es2017",
"dom"
]
},
"include": [
"src/*"
]
}
Hope this helps. 希望这可以帮助。
This is a bug in the LitElement docs . 这是LitElement文档中的错误 。 There error tells you what's wrong. 错误告诉您出了什么问题。 Typescript module
does not support ES2017
as a value. Typescript module
不支持将ES2017
作为值。 You should change it to es2015
or esnext
. 您应该将其更改为es2015
或esnext
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.