无法生成库。无效的规则结果:Promise类的实例

时间:2019-06-21 19:25:35

标签: angular-cli nrwl-nx angular-devkit

运行ng generate library mylib

我收到以下错误:

  

无效的规则结果:Promise类的实例。

我正在考虑这是一揽子问题,但我不知道如何找到导致问题的原因。

这里有我的package.json

{
  "dependencies": {
    "@angular/animations": "~7.2.12",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "~7.2.12",
    "@angular/compiler": "~7.2.12",
    "@angular/core": "~7.2.12",
    "@angular/flex-layout": "^7.0.0-beta.23",
    "@angular/forms": "~7.2.12",
    "@angular/material": "^7.3.7",
    "@angular/platform-browser": "~7.2.12",
    "@angular/platform-browser-dynamic": "~7.2.12",
    "@angular/router": "~7.2.12",
    "core-js": "^2.5.4",
    "hammerjs": "^2.0.8",
    "ngx-infinite-scroll": "^7.1.0",
    "oidc-client": "~1.6.1",
    "rxjs": "~6.4.0",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26",
    "@nrwl/angular": "^8.1.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "^7.3.8",
    "@angular/compiler-cli": "~7.2.12",
    "@angular/language-service": "~7.2.12",
    "@nrwl/workspace": "8.1.2",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~5.0.1",
    "dotenv": "6.2.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "^3.2.4"
  }
}

npm版本6.9.0

节点版本10.16.0

让我知道您是否还有其他需要。谢谢!

1 个答案:

答案 0 :(得分:1)

我通过更新angular-cli的全局版本解决了这个问题。

npm install -g @angular/cli