javascript - 运行 React Native 应用程序时出错 - 未知选项
问题描述
所以我一直在尝试学习应用程序开发的本机反应,并且我一直在处理许多错误,试图让一个非常简单的应用程序运行。我不得不删除 node_modules 并重新安装纱线。现在,在解决了我之前遇到的巨大错误之后,现在当我尝试运行它时,我的 cmd 中出现以下错误:
error: unknown option `--assetPlugins'
Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.
error Command failed with exit code 1.
我从今年早些时候在这里发现了一个类似的问题,但解决方案似乎是正确更新了 expo 版本,但我的 expo 是几天前在我开始教程时安装的。我的 app.js 文件中唯一的代码如下:
import React, {useState} from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
export default function App() {
const[outputText, setOutputText] = useState('New State');
return (
<View style={styles.container}>
<Text>{outputText}</Text>
<Button title="Change Text" onPress={() => setOutputText('the text changed')}/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
所以我不知道如何调试这个,我是全新的反应。在此先感谢您的帮助。我对反应感到非常沮丧,我已经尝试了一个多星期来完成一个简单的教程,而且我在每一步都遇到错误......
解决方案
推荐阅读
- reactjs - React-Bootstrap 是否需要 Bootstrap 依赖项
- excel - 使用 Excel Vba 在字符串变量中查找模式
- twitter-bootstrap - 更改Flask-微博导航栏背景颜色
- android - 授权 Adobe Reader 访问本地文件 - Android 上的 Flutter 应用
- azure-machine-learning-service - 复制/迁移 AzureML 服务实验
- python - 在python中重新排列链表
- ruby-on-rails - 如何为已弃用的 alias_method_chain 重构代码
- java - Spring boot 使用 QuerySL 获取具有多个可选参数的请求
- gis - 位于最北端的静态图像被拉伸
- exchangewebservices - 在撰写表单中用于 javascript 的 Outlook 加载项 API 中,是否可以在发送邮件之前要求对邮件进行已读回执?