【发布时间】:2019-12-06 07:02:15
【问题描述】:
node.js 窗口上的错误:
错误:捆绑失败:错误:无法从node_modules\@react-navigation\native\src\Scrollables.js 解析模块react-native-gesture-handler:在项目中找不到react-native-gesture-handler。
我认为错误与 npm 或 yarn 的库有关。
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
});
【问题讨论】:
-
投票this proposal 以缓解标签混淆。
标签: javascript react-native npm navigation yarnpkg