我正在使用expo构建本机应用程序,但是,我遇到了一个错误,因此无法继续构建该应用程序。我什至在错误消息中提到的node_modules中查找文件。我在屏幕导航中使用react-native-gesture-handler。如果我卸载了react-native-gesture-handler并删除了导航代码,是否可以解决我的错误?我该如何解决?
App.js
import win32serviceutil
import win32service
import win32event
import servicemanager
import socket
import listTT
from time import sleep
import telebot
import sys
class AppServerSvc (win32serviceutil.ServiceFramework):
_svc_name_ = "JUSTBOT"
_svc_display_name_ = "JUSTBOT"
def __init__(self,args):
win32serviceutil.ServiceFramework.__init__(self,args)
self.hWaitStop = win32event.CreateEvent(None,0,0,None)
#socket.setdefaulttimeout(15)
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
win32event.SetEvent(self.hWaitStop)
def SvcRestart(self):
if servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STARTED,
(self._svc_name_,'')):
win32serviceutil.RestartService(self._svc_name_)
self.main()
#def SvcDoRun(self):
# servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,
# servicemanager.PYS_SERVICE_STARTED,
# (self._svc_name_,''))
# self.main()
def main(self):
while True:
try:
listTT.bot.polling(none_stop=True, interval=2, timeout=2)
listTT.bot.infinity_polling(True)
except Exception:
pass
except AttributeError:
pass
except ReferenceError:
pass
except telebot.apihelper.requests.exceptions.ConnectionError:
pass
except ConnectionAbortedError:
pass
except ConnectionRefusedError:
pass
except ConnectionResetError:
pass
except RuntimeError:
pass
except telebot.apihelper.requests.exceptions.ConnectTimeout:
pass
except IndexError:
pass
except telebot.apihelper.requests.exceptions.ReadTimeout:
pass
except telebot.apihelper.requests.exceptions.RetryError:
pass
except telebot.apihelper.requests.exceptions.Timeout:
pass
except telebot.apihelper.requests.exceptions.HTTPError:
pass
except RecursionError:
pass
finally:
sleep(6)
if __name__ == '__main__':
if len(sys.argv) == 1:
servicemanager.Initialize()
servicemanager.PrepareToHostSingle(AppServerSvc)
servicemanager.StartServiceCtrlDispatcher()
else:
win32serviceutil.HandleCommandLine(AppServerSvc)
Home.js
import React, { Component } from 'react';
import { StackNavigator } from 'react-navigation';
import Plan from './screens/Plan';
import Home from './screens/Home';
const AppNavigator = StackNavigator({
PlanScreen: { screen: Home },
HomeScreen: { screen: Plan }
});
export default class App extends Component {
render() {
return (
<AppNavigator/>
)
}
}
答案 0 :(得分:2)
我刚刚在项目中通过执行npm install fbjs
解决了这个问题。
fbjs
实用程序具有所需的(并且缺少)"areEqual": "fbjs/lib/areEqual",
答案 1 :(得分:0)
您不能在component
中插入button
。删除components
。
Home.js
return (
<View>
<Text>Plan Name:</Text>
<TextInput style={{height: 40, borderColor: 'black', borderWidth: 0.8}}
onChangeText={(text) => this.setState({text})}
value={this.state.text}/>
<Button style={{ width: 50, alignSelf: "flex-end" }}
title="Add Plan"
onPress={() =>
this.props.navigation.navigate('PlanScreen')} />
</View>
)
或者您可以使用TouchableOpacity
import {
TouchableOpacity
} from 'react-native'
<TouchableOpacity onPress={() => this.props.navigation.navigate('PlanScreen')} >
<MyDatePicker/>
<ImageSelector/>
</TouchableOpacity>