我已经升级了我的Native脚本项目,该项目在以前的版本上运行良好。升级到8.1.5后,出现节点模块错误。
我的包.json
{
"description": "Order Next Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@angular-devkit/build-angular": "^13.1.2",
"@angular/animations": "^13.1.1",
"@angular/cli": "^13.1.2",
"@angular/common": "^13.1.1",
"@angular/compiler": "^13.1.1",
"@angular/core": "^13.1.1",
"@angular/forms": "^13.1.1",
"@angular/http": "^7.2.16",
"@angular/platform-browser": "^13.1.1",
"@angular/platform-browser-dynamic": "^13.1.1",
"@angular/router": "^13.1.1",
"@nativescript/angular": "^13.0.1",
"@nativescript/core": "^8.1.5",
"@nativescript/firebase": "^11.1.3",
"@ngtools/webpack": "^13.1.2",
"@nstudio/nativescript-checkbox": "^2.0.4",
"@nstudio/nativescript-loading-indicator": "^3.0.1",
"@types/node": "^17.0.9",
"font-awesome": "^4.7.0",
"nativescript-accordion": "^5.0.4",
"nativescript-drop-down": "^5.0.6",
"nativescript-feedback": "^2.0.0",
"nativescript-geolocation": "^5.1.0",
"nativescript-iqkeyboardmanager": "^1.5.1",
"nativescript-phone": "^1.4.0",
"nativescript-ratings": "^1.0.1",
"nativescript-ripple": "^4.0.1",
"nativescript-screen-orientation": "^1.0.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-listview": "^10.0.2",
"nativescript-youtubeplayer": "^3.0.1",
"reflect-metadata": "~0.1.10",
"rxjs": "~7.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular/compiler-cli": "^13.1.1",
"@nativescript/android": "8.1.1",
"@nativescript/schematics": "~0.4.0",
"@nativescript/types": "^8.1.1",
"@nativescript/webpack": "^5.0.4",
"typescript": "^4.5.4"
},
"readme": "NativeScript Application",
"main": "./src/main.ts"
}
我从依赖项中得到以下错误,
单击此处查看错误图像
Kindly help me with the solution.
您没有提到从哪一个版本的nativescript升级,但在迁移您的nativeDescript项目时,您必须根据本nativescription到NS6的迁移指南、到NS7的迁移指南和到NS8的迁移指南手动修改代码。
确保遵循所有步骤,对代码应用所需的更改,包括运行ns migrate
。
然而,在您提供的示例中,您似乎没有更新导入以匹配Angular 13和Nativescript 8。将您的导入更改为以下内容,您应该没事:
import { View, ObservableArray, CoercibleProperty, EventData, Property } from '@nativescript/core';
import { BaseValueAccessor } from "@nativescript/angular";