ANGLING NX Nrwl-尝试创建新库时,无法在JSON中分析tsconfig.base.json:PropertyNameExpect

gpfsuwkq  于 2022-09-18  发布在  Java
关注(0)|答案(1)|浏览(99)

我收到了这个错误

Cannot parse tsconfig.base.json: PropertyNameExpected in JSON at position 891

在CLI上运行nx g @nrwl\angular:lib libName

我的tsfig.base.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "rootDir": ".",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "module": "esnext",
    "lib": ["es2017", "dom"],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "baseUrl": ".",
    "paths": {
      "@admin-env/*": ["apps/admin/src/environments/*"],
      "@admin/*": ["apps/admin/src/app/*"],
      "@portal-env/*": ["apps/portal/src/environments/*"],
      "@portal/*": ["apps/portal/src/app/*"],
    }
  },
  "exclude": ["node_modules", "tmp"]
}

当我运行时,我收到错误Cannot parse tsconfig.base.json: PropertyNameExpected in JSON at position 891

当我尝试运行npx nx g @nrwl/angular:lib libNamenx g @nrwl/angular:lib时,也会发生同样的情况

我正在使用VScode编写代码,tsconfig.base.json中没有错误警告(lint

tzdcorbm

tzdcorbm1#

paths列表的末尾有一个逗号‘,’时,我收到了这个错误。

"@portal/*": ["apps/portal/src/app/*"],  <<< REMOVE this comma

相关问题