Angular编译警告:“在'@ angular / core'中未找到export'ɵɵdefineInjectable'

时间:2019-08-22 20:48:35

标签: angular npm package mqtt

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

  

./ node_modules / ngx-mqtt / src / mqtt.service.js 390:34-55中的警告   “在'@ angular / core'中找不到导出'ɵɵdefineInjectable'(导入为'i0')

     

./ node_modules / ngx-mqtt / src / mqtt.service.js 390中的警告:126-137   “在'@ angular / core'中找不到导出'ɵɵinject'(导入为'i0')

     

./ node_modules / ngx-mqtt / src / mqtt.service.js 390:161-172中的警告   “在'@ angular / core'中找不到导出'ɵɵinject'(导入为'i0')

这些是我来自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"
}

1 个答案:

答案 0 :(得分:0)

^中删除字符"ngx-mqtt": "^6.6.0"可解决此问题。