无法生成库。无效的规则结果:Promise 类的实例
Posted
技术标签:
【中文标题】无法生成库。无效的规则结果:Promise 类的实例【英文标题】:Cannot generate library. Invalid rule result: Instance of class Promise 【发布时间】:2019-11-04 15:42:24 【问题描述】:运行时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】:我通过更新 angular-cli 的全局版本解决了这个问题。
npm install -g @angular/cli
【讨论】:
在此之后我不得不删除 node_modules 文件夹。然后命令起作用了。谢谢。以上是关于无法生成库。无效的规则结果:Promise 类的实例的主要内容,如果未能解决你的问题,请参考以下文章