【问题标题】:Unknown compiler option '@angular/*'未知的编译器选项'@angular/*'
【发布时间】:2021-07-14 20:17:32
【问题描述】:

我试图使用声纳云来分析我的代码,使用 azure devops 管道

我在Run Code Analysis task 中遇到了这个错误,但最后还是通过了这一步:

14:53:52.353 INFO: Found 1 tsconfig.json file(s): [/home/vsts/work/1/s/tsconfig.json]
##[error]14:53:52.489 ERROR: Unknown compiler option '@angular/*'.
##[debug]Processed: ##vso[task.logissue type=error;]14:53:52.489 ERROR: Unknown compiler option '@angular/*'.
##[debug]Processed: 14:53:52.489 ERROR: Unknown compiler option '@angular/*'.##vso[task.logissue type=error;]

这是我的 tsconfig.json 文件

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "@angular/*": ["../node_modules/@angular/*"],
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

我能够生成 dist 文件。

谁能帮帮我

【问题讨论】:

    标签: azure-devops sonarqube


    【解决方案1】:

    删除违规行

    "@angular/*": ["../node_modules/@angular/*"],
    

    正如错误提示,@angular/* 不是a valid compilerOption

    另见https://angular.io/guide/angular-compiler-options

    【讨论】:

    • 感谢您的回复,但是当我删除此行时,控制台中显示多个错误
    • 我在 node_modules 文件夹中有编译器和编译器-cli
    猜你喜欢
    • 2017-03-17
    • 2021-12-29
    • 2018-05-27
    • 2019-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-09
    • 2018-07-25
    相关资源
    最近更新 更多