简体   繁体   English

将 Angular 10 项目转换为 nativescript 共享项目时出现“无法解析 tsconfig.json 文件”错误

[英]“Can't parse tsconfig.json file” error when converting Angular 10 project to nativescript shared project

I updated an Angular 8 project first to Angular 9 then Angular 10. After successfully updating to 10 and running ng serve to make sure the application still correctly works I followed the nativescript migration steps here .我首先将 Angular 8 项目更新为 Angular 9,然后是 Angular 10。在成功更新到 10 并运行 ng serve 以确保应用程序仍然正常工作后,我遵循了此处的 nativescript 迁移步骤。

When getting to the step where I add @nativescript/schematics I get the following error "File tsconfig.json could not be parsed!".当进入添加@nativescript/schematics 的步骤时,出现以下错误“无法解析文件 tsconfig.json!”。

I saw this stackoverflow question and plugged my tsconfig.json into the compiler and still couldn't figure out what was causing the error.我看到了这个stackoverflow问题并将我的 tsconfig.json 插入编译器,但仍然无法弄清楚是什么导致了错误。 All brackets seem to be closed directly.所有括号似乎直接关闭。

Any help on this is greatly appreciated!非常感谢您对此的任何帮助! Below is the code in my 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
  }
}

Ended up being the , after the single "lib" array.最终成为 , 在单个“lib”数组之后。 Was solely a JSON issue and not anything with the angular / nativescript migration.只是一个 JSON 问题,与 angular / nativescript 迁移无关。

Hope this helps someone else that ran into this simple but goofy error.希望这可以帮助遇到这个简单但愚蠢的错误的其他人。 cheers!干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在angular2项目中创建tsconfig.json文件? - How to create tsconfig.json file in angular2 project? 更新到 Angular 10 错误:无法将“tsconfig.json”解析为 JSON AST 对象 - Updating to Angular 10 error: Failed to parse “tsconfig.json” as JSON AST Object 如何配置 tsconfig.json 文件以包含角度库项目的 .ts 文件? - How to configure tsconfig.json file to include .ts files of an angular library project? 在角度 10 的 tsconfig.json 中找不到 typeRoots - typeRoots not found in tsconfig.json in angular 10 Angular 在 tsconfig.json 中声明的库路径别名不起作用:找不到模块:错误:无法解析 - Angular Library paths alias declared in tsconfig.json not working: Module not found: Error: Can't resolve 创建新的 Nativescript 和 Angular 共享项目时出错 - Error when creating new Nativescript and Angular shared project 在没有 tsconfig.json 全局项目级别的情况下,打字稿文件在 vs2017 中自动创建 Javascript - Typescript file auto create Javascript in vs2017 without tsconfig.json globally project level app.component.ts不在tsconfig.json定义的项目中 - app.component.ts is not in project defined by tsconfig.json Angular 7 找不到让 tsconfig.json 路径映射有效的方法 - Angular 7 Can't find a way to get tsconfig.json path mapping works 在 tsconfig.json 上使用路径无法使用 angular 解析 - using path on tsconfig.json doesn't resolve using angular
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM