gpt4 book ai didi

Angular 编译警告 : "export ' ɵɵdefineInjectable' was not found in '@angular/core'

转载 作者:行者123 更新时间:2023-12-04 12:39:31 24 4
gpt4 key购买 nike

我正在尝试为一个 Angular 应用程序提供服务,但是我从“ngx-mqtt”:“^6.6.0”中得到了这个依赖错误。我的本地 CLI 是 6.2.9 版本。我正在尝试更改此依赖项的版本,但我仍然收到此错误。我只是不明白为什么会这样。

WARNING in ./node_modules/ngx-mqtt/src/mqtt.service.js 390:34-55 "export 'ɵɵdefineInjectable' (imported as 'i0') was not found in '@angular/core'

WARNING in ./node_modules/ngx-mqtt/src/mqtt.service.js 390:126-137 "export 'ɵɵinject' (imported as 'i0') was not found in '@angular/core'

WARNING in ./node_modules/ngx-mqtt/src/mqtt.service.js 390:161-172 "export 'ɵɵinject' (imported as 'i0') was not found in '@angular/core'



这些是我从 package.json 中的主要依赖项
 "dependencies": {
"@angular/animations": "^6.1.7",
"@angular/cdk": "^6.4.7",
"@angular/cli": "~6.2.1",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/compiler-cli": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/flex-layout": "^6.0.0-beta.18",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^6.4.7",
"@angular/material-moment-adapter": "^6.4.7",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@fortawesome/angular-fontawesome": "^0.3.0",
"@fortawesome/fontawesome-svg-core": "^1.2.21",
"@fortawesome/free-regular-svg-icons": "^5.10.1",
"@fortawesome/free-solid-svg-icons": "^5.10.1",
...
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular/language-service": "^6.1.0",
"@types/core-js": "^2.5.0",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^2.9.2"
}

最佳答案

删除字符 ^来自 "ngx-mqtt": "^6.6.0"解决了问题。

关于 Angular 编译警告 : "export ' ɵɵdefineInjectable' was not found in '@angular/core' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57616856/

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