找不到模块:"nativescript-angular/http",相对于:app/tns_modules/
Failed to find module: "nativescript-angular/http", relative to: app/tns_modules/
我将 NativeScript 6.1.1 与 Angular 8.0 一起使用,我确实在某些时候使用了 'tns preview',但现在当我尝试 运行 'tns preview' 并使用我的三星 Galaxy S8 (Android 7) 我收到此错误
Successfully sent initial files for platform android.
LOG from device Galaxy S8: com.tns.Runtime.callJSMethodNative(Native Method)
LOG from device Galaxy S8: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
LOG from device Galaxy S8: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1083)
LOG from device Galaxy S8: ERROR Error: Uncaught (in promise): Error: com.tns.NativeScriptException: Failed to find module: "nativescript-angular/http", relative to: app/tns_modules/
LOG from device Galaxy S8: com.tns.Module.resolvePath(Module.java:56)
LOG from device Galaxy S8: com.tns.Module.resolvePathHelper(Module.java:151)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1063)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1055)
LOG from device Galaxy S8: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:20)
LOG from device Galaxy S8: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
LOG from device Galaxy S8: android.app.Activity.performCreate(Activity.java:6955)
LOG from device Galaxy S8: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
LOG from device Galaxy S8: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
LOG from device Galaxy S8: and...
LOG from device Galaxy S8: android.app.ActivityThread.-wrap14(ActivityThread.java)
我试过用;
刷新所有内容
rm -rf node_modules platforms hooks
npm i
tns run android
tns preview
这没有帮助。它在模拟器中工作。我尝试改用 http-client,但它无法启动。我已经更新到最新的软件包,但也没有帮助。
从 Angular 开始,8 @angular/http
已删除,因此 nativescript-angular/http
。
您必须 migrate 到 NativeScriptHttpClientModule
我将 NativeScript 6.1.1 与 Angular 8.0 一起使用,我确实在某些时候使用了 'tns preview',但现在当我尝试 运行 'tns preview' 并使用我的三星 Galaxy S8 (Android 7) 我收到此错误
Successfully sent initial files for platform android.
LOG from device Galaxy S8: com.tns.Runtime.callJSMethodNative(Native Method)
LOG from device Galaxy S8: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
LOG from device Galaxy S8: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1083)
LOG from device Galaxy S8: ERROR Error: Uncaught (in promise): Error: com.tns.NativeScriptException: Failed to find module: "nativescript-angular/http", relative to: app/tns_modules/
LOG from device Galaxy S8: com.tns.Module.resolvePath(Module.java:56)
LOG from device Galaxy S8: com.tns.Module.resolvePathHelper(Module.java:151)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1063)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1055)
LOG from device Galaxy S8: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:20)
LOG from device Galaxy S8: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
LOG from device Galaxy S8: android.app.Activity.performCreate(Activity.java:6955)
LOG from device Galaxy S8: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
LOG from device Galaxy S8: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
LOG from device Galaxy S8: and...
LOG from device Galaxy S8: android.app.ActivityThread.-wrap14(ActivityThread.java)
我试过用;
刷新所有内容rm -rf node_modules platforms hooks
npm i
tns run android
tns preview
这没有帮助。它在模拟器中工作。我尝试改用 http-client,但它无法启动。我已经更新到最新的软件包,但也没有帮助。
从 Angular 开始,8 @angular/http
已删除,因此 nativescript-angular/http
。
您必须 migrate 到 NativeScriptHttpClientModule