Javascript 启动Angular 11项目时出现配置错误
我只是创建了一个项目,没有做任何更改。它在Javascript 启动Angular 11项目时出现配置错误,javascript,typescript,tsconfig,lit-element,angular11,Javascript,Typescript,Tsconfig,Lit Element,Angular11,我只是创建了一个项目,没有做任何更改。它在tsconfig.json文件中显示错误。我试图通过将es2020更改为es2015来修复此问题,但它没有修复错误 TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'. 这是我的tsconfig.json { "compileOnSave": f
tsconfig.json
文件中显示错误。我试图通过将es2020
更改为es2015
来修复此问题,但它没有修复错误
TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.
这是我的tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictPropertyInitialization": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
如何解决此问题。使用
模块更新您的tsconfig.app.json
文件:“es2015”
我认为问题在于:
“模块”:“amd”,
而Lit需要一个ES模块变体。“模块”:“es2020”它应该是
“模块”:“es2015”
也可以作为建议,但这并不能修复错误