执行时出现下一个错误:tns运行android。安装“ nativescript-ui-sidedrawer”插件并删除android平台后,问题开始了。
System.err: Error: com.tns.NativeScriptException: Failed to find module: "nativescript-angular/platform", relative to: app/tns_modules/
System.err: com.tns.Module.resolvePathHelper(Module.java:146)
System.err: com.tns.Module.resolvePath(Module.java:55)
System.err: com.tns.Runtime.runModule(Native Method)
System.err: com.tns.Runtime.runModule(Runtime.java:553)
System.err: com.tns.Runtime.run(Runtime.java:545)
System.err: com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err: android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
System.err: android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
System.err: android.app.ActivityThread.-wrap3(ActivityThread.java)
System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
System.err: android.os.Handler.dispatchMessage(Handler.java:102)
System.err: android.os.Looper.loop(Looper.java:154)
System.err: android.app.ActivityThread.main(ActivityThread.java:6682)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
System.err: File: "<unknown>, line: 1, column: 265
System.err:
System.err: StackTrace:
System.err: Frame: function:'require', file:'', line: 1, column: 266
System.err: Frame: function:'', file:'file:///data/data/org.nativescript.conFusion/files/app/main.js', line: 4, column: 18
System.err: Frame: function:'require', file:'', line: 1, column: 266
我的package.json看起来:
{
"nativescript": {
"id": "org.nativescript.conFusion",
"tns-ios": {
"version": "5.0.0"
},
"tns-android": {
"version": "5.0.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@angular/animations": "~6.1.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-sidedrawer": "^5.0.0",
"reflect-metadata": "~0.1.8"
},
"devDependencies": {
"@angular/common": "^6.1.10",
"@angular/compiler": "^6.1.10",
"@angular/compiler-cli": "~6.1.0",
"@angular/core": "^6.1.10",
"@angular/forms": "^6.1.10",
"@angular/http": "^6.1.10",
"@angular/platform-browser": "^6.1.10",
"@angular/platform-browser-dynamic": "^6.1.10",
"@angular/router": "^6.1.10",
"@nativescript/schematics": "~0.3.0",
"@ngtools/webpack": "^6.2.7",
"css-loader": "^1.0.1",
"extract-text-webpack-plugin": "^3.0.2",
"nativescript-angular": "^6.2.0",
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "~0.17.0",
"rxjs": "^6.0.0",
"sass-loader": "^7.1.0",
"tns-core-modules": "^5.0.2",
"typescript": "^2.7.2",
"webpack": "^4.0.0",
"zone.js": "^0.8.26"
},
"readme": "NativeScript Application"
}
我删除并重新安装了钩子,平台和节点模块目录,但是错误仍然存在。我不知道下一步是什么。