"Can't parse tsconfig.json file" 将 Angular 10 项目转换为 nativescript 共享项目时出错

"Can't parse tsconfig.json file" error when converting Angular 10 project to nativescript shared project

我先将一个 Angular 8 项目更新为 Angular 9,然后 Angular 10。成功更新到 10 和 运行 ng serve 以确保应用程序仍然可用正常工作 我遵循了 nativescript 迁移步骤 here.

当到达添加@nativescript/schematics 的步骤时,出现以下错误“无法解析文件 tsconfig.json!”。

我看到了这个 问题并将我的 tsconfig.json 插入了编译器,但仍然无法找出导致错误的原因。好像所有的括号都直接关闭了。

非常感谢对此的任何帮助!下面是我的 tsconfig.json:

中的代码
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

最终成为单个“lib”数组之后的 , 。仅仅是 JSON 问题,与 angular / nativescript 迁移无关。

希望这可以帮助 运行 的其他人解决这个简单但愚蠢的错误。干杯!