Removing "Solution Style" TypeScript configuration file-6ren">
gpt4 book ai didi

angular - 更新到 Angular 10 错误 : Failed to parse "tsconfig.json" as JSON AST Object

转载 作者:行者123 更新时间:2023-12-04 11:17:15 25 4
gpt4 key购买 nike

我正在尝试将 Angular 9 应用程序更新为 Angular 10 并出现错误:

> Removing "Solution Style" TypeScript configuration file support.
× Migration failed: Failed to parse "tsconfig.json" as JSON AST Object. PropertyNameExpected at location: 571.
See "C:\Users\F11K\AppData\Local\Temp\ng-T8Bgiu\angular-errors.log" for further details.
这是日志文件的内容:
[error] Error: Failed to parse "tsconfig.json" as JSON AST Object. PropertyNameExpected at location: 571.
at JSONFile.get JsonAst [as JsonAst] (C:\Users\F11K\Documents\server\angular-client\node_modules\@schematics\angular\utility\json-file.js:33:19)
at JSONFile.get (C:\Users\F11K\Documents\server\angular-client\node_modules\@schematics\angular\utility\json-file.js:41:61)
at C:\Users\F11K\Documents\server\angular-client\node_modules\@schematics\angular\migrations\update-10\remove-solution-style-tsconfig.js:33:71
at MergeMapSubscriber.project (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\rules\call.js:75:24)
at MergeMapSubscriber._tryNext (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:67:27)
at MergeMapSubscriber._next (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:57:18)
at MergeMapSubscriber.Subscriber.next (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Subscriber.js:66:18)
at Observable._subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\util\subscribeToArray.js:5:20)
at Observable._trySubscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:44:25)
at Observable.subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:30:22)
at MergeMapOperator.call (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:37:23)
at Observable.subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:25:31)
at MapOperator.call (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\map.js:32:23)
at Observable.subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:25:31)
at Object.innerSubscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\innerSubscribe.js:102:23)
at MergeMapSubscriber._innerSub (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:80:50)

[error] Error: Failed to parse "tsconfig.json" as JSON AST Object. PropertyNameExpected at location: 571.
at JSONFile.get JsonAst [as JsonAst] (C:\Users\F11K\Documents\server\angular-client\node_modules\@schematics\angular\utility\json-file.js:33:19)
at JSONFile.get (C:\Users\F11K\Documents\server\angular-client\node_modules\@schematics\angular\utility\json-file.js:41:61)
at C:\Users\F11K\Documents\server\angular-client\node_modules\@schematics\angular\migrations\update-10\remove-solution-style-tsconfig.js:33:71
at MergeMapSubscriber.project (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\rules\call.js:75:24)
at MergeMapSubscriber._tryNext (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:67:27)
at MergeMapSubscriber._next (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:57:18)
at MergeMapSubscriber.Subscriber.next (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Subscriber.js:66:18)
at Observable._subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\util\subscribeToArray.js:5:20)
at Observable._trySubscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:44:25)
at Observable.subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:30:22)
at MergeMapOperator.call (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:37:23)
at Observable.subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:25:31)
at MapOperator.call (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\map.js:32:23)
at Observable.subscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:25:31)
at Object.innerSubscribe (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\innerSubscribe.js:102:23)
at MergeMapSubscriber._innerSub (C:\Users\F11K\AppData\Local\Temp\angular-cli-packages-dD436h\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:80:50)
我查看了 tsconfig.json并手动调整: "module": "esnext" => "module": "es2020"但它没有用。
日志让我感到困惑,因为它不是让我正确发生错误的地方,你能帮忙吗?非常感谢。 tsconfig.json的内容:
{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo",
"module": "es2020",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types",
"tests"
],
"lib": [
"es2018",
"dom"
],
"baseUrl": "src",
}
}

最佳答案

删除不必要的“,”对我有用。在您的问题中,可以通过删除 "baseUrl": "src"之后的 ","来解决

关于angular - 更新到 Angular 10 错误 : Failed to parse "tsconfig.json" as JSON AST Object,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63887135/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com