【发布时间】:2019-10-24 14:47:03
【问题描述】:
我正在使用 NativeScript 构建一个全新的应用程序,但我在使用 nativescript cli 创建组件/服务/等时遇到问题。我只是不断得到:
Error: Invalid rule result: Instance of class Promise.
at t.project (/usr/local/lib/node_modules/nativescript/node_modules/@nativescript/schematics-executor/dist/index.js:250:1038)
...
我查看了这种错误,所有的修复方法是使用相同版本的 @angular/cli 和 @schemics/angular,然后删除 package-lock.json 和 node_modules,但这些都不起作用。 下面是 package.json
{
"nativescript": {
"id": "com.domain.app",
"tns-android": {
"version": "6.0.2"
},
"tns-ios": {
"version": "6.0.2"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"scripts": {
"lint": "tslint \"src/**/*.ts\""
},
"dependencies": {
"@angular/animations": "~8.2.0",
"@angular/common": "~8.2.0",
"@angular/compiler": "~8.2.0",
"@angular/core": "~8.2.0",
"@angular/forms": "~8.2.0",
"@angular/platform-browser": "~8.2.0",
"@angular/platform-browser-dynamic": "~8.2.0",
"@angular/router": "~8.2.0",
"nativescript-angular": "~8.2.0",
"nativescript-angular-cli": "^0.1.9",
"nativescript-theme-core": "~1.0.6",
"nativescript-ui-sidedrawer": "~7.0.0",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.4.0",
"tns-core-modules": "~6.0.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular/cli": "^8.2.0",
"@angular/compiler-cli": "8.2.0",
"@nativescript/schematics": "^0.7.2",
"@ngtools/webpack": "~8.2.0",
"@schematics/angular": "^8.2.0",
"codelyzer": "~4.5.0",
"nativescript-dev-webpack": "~1.1.0",
"node-sass": "^4.7.1",
"tslint": "~5.11.0",
"typescript": "~3.5.3"
},
"gitHead": "42f2a6a9c94eaf9c68d2a41e0daaa1a2544bc28f",
"readme": "NativeScript Application"
}
还有什么我可以做的吗?大家有没有看到什么奇怪的东西?这只是一个全新的应用程序。而且我已经用 Nativescipt(旧版本)构建了两三个应用程序,没有这样的问题。
【问题讨论】:
-
是的,我看到了。出于这个原因,我澄清说拥有相同版本的@angular/cli 和Schematics/angular 并不能解决问题
-
这里有同样的问题
标签: angular nativescript nativescript-angular tns