NPM无法正确更新软件包

时间:2019-05-30 21:01:01

标签: javascript react-native npm

在我的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

实时重新加载(刷新应用程序)后,错误消失了,我可以正常使用我的应用程序了。

可能出了什么问题?为什么我总是必须重新安装该库才能修复错误?

1 个答案:

答案 0 :(得分:0)

通过从我的Podfile中删除以下子规格来解决。 enter image description here