Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/431.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 错误:角度JIT编译失败:'@角度/编译器';未加载_Javascript_Angular_Typescript_Angular Compiler_Angular Cli V9 - Fatal编程技术网

Javascript 错误:角度JIT编译失败:'@角度/编译器';未加载

Javascript 错误:角度JIT编译失败:'@角度/编译器';未加载,javascript,angular,typescript,angular-compiler,angular-cli-v9,Javascript,Angular,Typescript,Angular Compiler,Angular Cli V9,在使用VSCode的开发环境中运行应用程序时突然出现的错误 main.js:7740 ERROR Error: Angular JIT compilation failed: '@angular/compiler' not loaded! - JIT compilation is discouraged for production use-cases! Consider AOT mode instead. - Did you bootstrap using

在使用VSCode的开发环境中运行应用程序时突然出现的错误



    main.js:7740 ERROR Error: Angular JIT compilation failed: '@angular/compiler' not loaded!
      - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.
      - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?
      - Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.
        at getCompilerFacade (vendor.js:20189)
        at Function.get (vendor.js:33871)
        at getInjectableDef (vendor.js:19941)
        at resolveNgModuleDep (vendor.js:47812)
        at NgModuleRef_.get (vendor.js:48688)
        at resolveDep (vendor.js:49213)
        at createClass (vendor.js:49071)
        at createDirectiveInstance (vendor.js:48882)
        at createViewNodes (vendor.js:60498)
        at callViewAction (vendor.js:60948)

还有一个错误是

角度扩展可能无法正常工作,因为ngcc操作失败。尝试通过运行“npm/run ngcc”手动调用ngcc。有关更多信息,请参阅扩展输出

Package.json包含以下内容



    {
      "name": "dxfsuite",
      "version": "0.0.0",
      "scripts": {
        "ng": "ng",
        "start": "ng serve -o --proxy-config proxy.conf.json --port 4200",
        "build": "ng build",
        "build-prod": "ng build --prod --stats-json --source-map=false",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
      },
      "private": true,
      "dependencies": {
        "@angular-devkit/schematics-cli": "^0.901.14",
        "@angular/animations": "~9.0.0",
        "@angular/cdk": "^9.1.0",
        "@angular/common": "~9.0.0",
        "@angular/compiler": "~9.0.0",
        "@angular/core": "~9.0.0",
        "@angular/forms": "~9.0.0",
        "@angular/localize": "^9.1.13",
        "@angular/platform-browser": "~9.0.0",
        "@angular/platform-browser-dynamic": "~9.0.0",
        "@angular/router": "~9.0.0",
        "@elastic/apm-rum-angular": "^0.5.0",
        "@fullcalendar/angular": "^4.4.5-beta",
        "@fullcalendar/core": "^4.4.0",
        "@fullcalendar/daygrid": "^4.4.0",
        "@fullcalendar/timegrid": "^4.4.0",
        "@ionic/angular": "^5.5.4",
        "@ng-bootstrap/ng-bootstrap": "^6.0.0",
        "@ng-select/ng-select": "^3.7.2",
        "@swimlane/ngx-charts": "^13.0.2",
        "@types/jquery": "^3.5.5",
        "angular-feather": "^6.1.0",
        "apexcharts": "^3.25.0",
        "bootstrap": "^4.6.0",
        "bootstrap-daterangepicker": "^3.0.5",
        "bootstrap-tagsinput": "^0.7.1",
        "daterangepicker": "^3.0.5",
        "install-peers": "^1.0.3",
        "jquery": "^3.4.1",
        "jqueryui": "^1.11.1",
        "loadash": "^1.0.0",
        "lodash": "^4.17.15",
        "moment": "^2.26.0",
        "moment-timezone": "^0.5.33",
        "ng-apexcharts": "^1.5.8",
        "ng-zorro-antd": "^9.0.0-beta.0",
        "ng2-daterangepicker": "^2.0.12",
        "ngx-filesize": "^2.0.13",
        "ngx-perfect-scrollbar": "^8.0.0",
        "ngx-sortablejs": "^3.1.4",
        "ngx-spinner": "^10.0.1",
        "peity": "^3.3.0",
        "popper.js": "^1.16.1",
        "ramda": "^0.26.1",
        "rxjs": "^6.5.4",
        "service-worker": "0.0.0",
        "sortablejs": "^1.13.0",
        "tslib": "^1.10.0",
        "videogular2": "^7.0.2",
        "vivus": "^0.4.5",
        "web-push": "^3.4.3",
        "zone.js": "~0.10.2"
      },
      "devDependencies": {
        "@angular-devkit/build-angular": "~0.900.1",
        "@angular/cli": "~9.0.1",
        "@angular/compiler-cli": "~9.0.0",
        "@angular/language-service": "~9.0.0",
        "@ionic/angular-toolkit": "^3.1.0",
        "@types/jasmine": "~3.3.8",
        "@types/jasminewd2": "~2.0.3",
        "@types/node": "^12.20.1",
        "codelyzer": "^5.1.2",
        "jasmine-core": "~3.4.0",
        "jasmine-spec-reporter": "~4.2.1",
        "karma": "^4.4.1",
        "karma-chrome-launcher": "~2.2.0",
        "karma-coverage-istanbul-reporter": "~2.0.1",
        "karma-jasmine": "~2.0.1",
        "karma-jasmine-html-reporter": "^1.4.0",
        "protractor": "~5.4.0",
        "ts-node": "~7.0.0",
        "tslint": "~5.15.0",
        "typescript": "~3.7.5"
      }
    }

和itsconfig.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
      }
    }

{
“保存”:false,
“编译器选项”:{
“baseUrl”:“/”,
“outDir”:“/dist/out tsc”,
“源地图”:正确,
“声明”:虚假,
“向下迭代”:正确,
“实验生态学者”:没错,
“模块”:“esnext”,
“moduleResolution”:“节点”,
“进口者”:没错,
“目标”:“es2015”,
“类型根”:[
“节点\模块/@类型”
],
“lib”:[
“es2018”,
“dom”
]
},
“角度编译器选项”:{
“fullTemplateTypeCheck”:真,
“strictInjectionParameters”:true
}
}
搜索了许多论坛来解决这个问题。但是没有什么对我有帮助


请帮助

对于我来说是由Angular语言服务扩展引起的

  • 在扩展设置中启用旧版视图引擎
  • 删除节点\u模块文件夹
  • 运行
    npm安装
  • 编辑:应该已经修复。

    一些人建议(即禁用常春藤并重新安装
    node\u模块
    ),但它在不禁用常春藤的情况下对我有效。我不得不还原我的
    包.json
    ,因为它不知怎么被更改了,然后删除了
    node\u模块
    ,然后运行
    npmi
    来还原模块。