core.js:4031 Uncaught 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 (core.js:4031)
at Function.get (core.js:26915)
at getNgModuleDef (core.js:1117)
at assertNgModuleType (core.js:1296)
at compileNgModuleFactory__POST_R3__ (core.js:29062)
at PlatformRef.boo**strong text**tstrapModule (core.js:29309)
at Module.4431 (main.ts:11)
at __webpack_require_***strong text***_ (bootstrap:19)
at __webpack_exec__ (main.js:223)
at main.js:224即使在更新了我的npm之后,我也会遇到这样的错误。
发布于 2021-05-22 12:25:31
根据(https://github.com/angular/angular-cli/issues/16873)(建议阅读前面的链接,因为我很快就会解释),这个问题可以通过以下方式来解决:
1-运行npm update来更新依赖项。
2-您有一个angular.json文件,它应该包含一个aot=true,如果不是自己添加它,那么添加postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points,然后删除node_modules和包锁文件来重新安装。
3-在tsconfig.json文件"angularCompilerOptions": { "fullTemplateTypeCheck": true, "strictInjectionParameters": true, "enableIvy": false }上禁用常春藤引擎
有时,如果你降低你的角度Cli版本,这个问题就会得到解决。
https://stackoverflow.com/questions/67648892
复制相似问题