Javascript 开发服务器返回响应错误代码:500
node.js窗口中出现错误: 错误:绑定失败:错误:无法从Javascript 开发服务器返回响应错误代码:500,javascript,react-native,npm,navigation,yarnpkg,Javascript,React Native,Npm,Navigation,Yarnpkg,node.js窗口中出现错误: 错误:绑定失败:错误:无法从节点\u modules\@react navigation\native\src\Scrollables.js中解析模块反应本机手势处理程序:在项目中找不到反应本机手势处理程序 我认为错误与npm或纱线的库有关 App.js代码: import React, {Component} from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View,
节点\u modules\@react navigation\native\src\Scrollables.js中解析模块反应本机手势处理程序
:在项目中找不到反应本机手势处理程序
我认为错误与npm或纱线的库有关
App.js代码:
import React, {Component} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
Button
} from 'react-native';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation';
class FirstPage extends Component{
render(){
return(
<View>
<Text>This is the first page.</Text>
<Button onPress={()=>this.props.navigation.navigate('test')} title="Go to the second page"/>
</View>
)
}
}
class SecondPage extends Component{
render(){
return(
<View>
<Text>This is the second page.</Text>
<Button onPress={()=>this.props.navigation.navigate('home')} title="Go to the first page"/>
</View>
)
}
}
export default createStackNavigator({
home:FirstPage,
test:SecondPage
});
import React,{Component}来自'React';
进口{
安全区域视图,
样式表,
滚动视图,
看法
文本,
状态栏,
按钮
}从“反应本机”;
从“react navigation”导入{createAppContainer};
从“反应导航”导入{createStackNavigator};
类FirstPage扩展组件{
render(){
返回(
这是第一页。
this.props.navigation.navigate('test')}title=“转到第二页”/>
)
}
}
类SecondPage扩展组件{
render(){
返回(
这是第二页。
this.props.navigation.navigate('home')}title=“转到第一页”/>
)
}
}
导出默认createStackNavigator({
主页:首页,
测试:第二页
});
您只需安装react native手势处理程序
,因为react navaigation
使用了它。因此,要了解更多说明,您可以浏览文档,您需要安装以下软件包以及raeact导航,以使其正常工作
你可以加上
yarn add react-navigation react-native-gesture-handler react-native-reanimated react-native-screens
或
希望能有帮助。不要怀疑是的。react native docs给出了答案。非常感谢@Patrissol KenfackVote继续,以缓解标签混淆。
npm i react-navigation react-native-gesture-handler react-native-reanimated react-native-screens