gpt4 book ai didi

angular - 在 'ɵcmf' 中找不到导出 '@angular/core'

转载 作者:太空狗 更新时间:2023-10-29 17:43:50 29 4
gpt4 key购买 nike

启动 webpack-dev-server 时会抛出以下警告:

WARNING in ./~/@angular/compiler/@angular/compiler.es5.js
11051:13-17 "export 'ɵcmf' was not found in '@angular/core'

WARNING in ./~/@angular/compiler/@angular/compiler.es5.js
11056:13-17 "export 'ɵmod' was not found in '@angular/core'

WARNING in ./~/@angular/compiler/@angular/compiler.es5.js
11061:13-17 "export 'ɵmpd' was not found in '@angular/core'

因为它只是一个警告,所以在尝试访问应用程序时仍会生成和提供输出

Uncaught TypeError: jit_val0 is not a function
at eval (module.ngfactory.js? [sm]:1)
at evalExpression (compiler.es5.js:26423)
at jitStatements (compiler.es5.js:26435)
at JitCompiler._compileModule (compiler.es5.js:26716)
at compiler.es5.js:26655
at Object.then (compiler.es5.js:1679)
at JitCompiler._compileModuleAndComponents (compiler.es5.js:26653)
at JitCompiler.compileModuleAsync (compiler.es5.js:26582)
at PlatformRef_._bootstrapModuleWithZone (core.es5.js:4811)
at PlatformRef_.bootstrapModule (core.es5.js:4797)
(anonymous) @ module.ngfactory.js? [sm]:1
evalExpression @ compiler.es5.js:26423
jitStatements @ compiler.es5.js:26435
JitCompiler._compileModule @ compiler.es5.js:26716
(anonymous) @ compiler.es5.js:26655
then @ compiler.es5.js:1679
JitCompiler._compileModuleAndComponents @ compiler.es5.js:26653
JitCompiler.compileModuleAsync @ compiler.es5.js:26582
PlatformRef_._bootstrapModuleWithZone @ core.es5.js:4811
PlatformRef_.bootstrapModule @ core.es5.js:4797
(anonymous) @ main.ts:12
__webpack_require__ @ bootstrap 91fab75…:54
(anonymous) @ main.bundle.js:20785
__webpack_require__ @ bootstrap 91fab75…:54
webpackJsonpCallback @ bootstrap 91fab75…:25
(anonymous) @ main.bundle.js:1

被抛出并且 Angular 没有成功引导。

最佳答案

如果你运行“ng -v”,你是否在同一版本中拥有所 Angular 依赖项?

我遇到了完全相同的问题,当我执行该命令时,结果是:

@angular/cli: 1.0.1
node: 6.11.0
os: linux x64
@angular/animations: 4.2.3
@angular/common: 4.2.3
@angular/compiler: 4.2.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/platform-server: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.0

我更改了 package.json 并使用 4.2.3 版本设置了所有依赖项,然后运行“rm -rf node_modules && npm install”,现在可以正常工作了!

关于angular - 在 'ɵcmf' 中找不到导出 '@angular/core',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44656265/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com