javascript - TypeError:未定义不是函数(评估“addListener”)
问题描述
感觉有很多类似的问题就像这个一样,但似乎没有一个适合我的解决方案。这绝对不是与代码相关的问题,一切正常,我运行了更新,现在我无法通过这个错误,一些包显然不能一起工作。
这是我的堆栈跟踪:
TypeError: undefined is not a function (evaluating 'addListener')
This error is located at:
in CardStack (at CardStackTransitioner.js:67)
in RCTView (at View.js:71)
in View (at Transitioner.js:142)
in Transitioner (at CardStackTransitioner.js:19)
in CardStackTransitioner (at StackNavigator.js:41)
in Unknown (at createNavigator.js:13)
in Navigator (at createNavigationContainer.js:226)
in NavigationContainer (at Router.js:70)
in App (at Router.js:91)
in Router (at Router.js:10)
in RouterComponent (at App.js:41)
in Provider (at App.js:40)
in App (at registerRootComponent.js:35)
in RootErrorBoundary (at registerRootComponent.js:34)
in ExpoRootComponent (at renderApplication.js:35)
in RCTView (at View.js:71)
in View (at AppContainer.js:102)
in RCTView (at View.js:71)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:34)
- node_modules\react-native-router-flux\node_modules\react-navigation\src\getChildEventSubscriber.js:72:60 in <unknown>
- node_modules\react-native-router-flux\node_modules\react-navigation\src\getChildEventSubscriber.js:72:45 in getChildEventSubscri
ber
- ... 28 more stack frames from framework internals
这是我当前的依赖项:
"dependencies": {
"expo": "^25.0.1",
"firebase": "^4.13.1",
"lodash": "^4.17.10",
"react": "16.2.0",
"react-native": "^0.52.3",
"react-native-router-flux": "^4.0.0-beta.30",
"react-native-scripts": "^1.14.0",
"react-navigation-redux-helpers": "^1.0.6",
"react-redux": "^5.0.7",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "22.4.0",
"babel-preset-react-native": "4.0.0",
"jest": "22.4.0",
"jest-expo": "^25.1.0",
"react-test-renderer": "16.2.0"
},
希望有人遇到过和我一样的依赖问题!
非常感谢,
亚当
解决方案
找到对我有用的东西:
rm -rf node_modules
yarn cache clean
yarn install
如评论中所见:https ://github.com/aksonov/react-native-router-flux/issues/2799
推荐阅读
- c++ - 可变参数获取不起作用
- asp.net - 发布到 Web API 控制器时来自 Web 表单的 404 错误
- yii - 在某些情况下,如果 YII_DEBUG=false,Yii 没有使用我的错误页面
- go - 不允许通过经销商 API 将第一个用户添加到新配置的客户
- python - 使用“Bf”格式化程序解包结构
- bash - 在shell脚本中为文本文件分配名称
- json - 在读取/加载时保留原始 JSON 作为 Spark DataFrame 中的列?
- python - 运行烧瓶应用程序时Nginx 502 Bad Gateway错误,但可以手动运行
- javascript - 简单的 javascritp 幻灯片 - 添加控件
- java - java Mail API 用于从 java 程序发送电子邮件,但显示 SMTP 协议错误