簡體   English   中英

NPM不會正確更新包

[英]NPM does not update package properly

在我的React Native( version 0.59.5 )應用程序中,我安裝並鏈接了最新版本的React Native Gesture Handlerversion 1.2.2 )。 每當我在模擬器上運行應用程序時,我在成功構建后立即收到以下消息:

TypeError: param is not an Object. (evaluating "__isNative' in param')

This error is located at:
  inPanGestureHandler (at StackViewLayout.js:300)
  in StackViewLayout (at withOrientation.js:30)
  in withOrientation (at StackView.js:79)
  in RCTView (at View.js:45)
  in View (at Transitioner.js:215)
  in Transitioner (at StackView.js22)
  in StackView (created by Navigator)
  in Navigator (at createKeyboardAwareNavigator.js:12)
  in KeyboardAwareNavigator (created by SceneView)
  in SceneView (at createTabNavigator.js:39)
  in RCTView (at View.js:45)
  in View (at ResourceSavingScene.js:26)
  in ResourceSavingScene (at createBottomTabNavigator.js:113)
  in RCTView (at View.js:45)
  in View (at screens.native.js:83)
  in ScreenContainer (at createBottomTabNavigator.js:103)
  in RCTView (at View.js:45)
  in View (at createBottomTabNavigator.js:102)
  in TabNavigationView (at createTabNavigator.js:197)

但是,當我重新安裝庫而不關閉或重新啟動模擬器時,使用以下命令:

npm install --save react-native-gesture-handler@latest

在我重新加載(刷新應用程序)后,錯誤消失了,我可以正確使用我的應用程序。

可能出了什么問題? 為什么我總是必須重新安裝庫才能修復錯誤?

解決方法是從我的Podfile中刪除以下子規范。 在此輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM