简体   繁体   English

尝试使用 expo 构建 create-react-app 项目,引发有关 react-native 的错误

[英]Trying to build a create-react-app project with expo, throws error about react-native

I've created my react app using create-react-app, and was trying to use expo, but its throwing errors when I try and build it using expo build:android :我已经使用 create-react-app 创建了我的 React 应用程序,并试图使用 expo,但是当我尝试使用expo build:android构建它时它抛出错误:

Error: Can't find react-native in package.json dependencies
Error: React Native is not installed. Please run `npm install` in your project directory.

Do I need to start over with a react-native project, or is there a way to continue on and get this project published?我是否需要重新开始一个 react-native 项目,或者有没有办法继续并发布这个项目?

I suggest you create your project using the expo docs :我建议您使用expo docs创建您的项目:

npm install expo-cli --global

expo init my-new-project
cd my-new-project
expo start

Try this:尝试这个:

  • Remove node_modules folder.删除 node_modules 文件夹。
  • run "yarn install".运行“纱线安装”。
  • run "expo start".运行“博览会开始”。

This looks like a similar issue on this github error这看起来像这个 github 错误的类似问题

https://github.com/expo/expo-cli/issues/248 https://github.com/expo/expo-cli/issues/248

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 领域和反应错误。 无法在使用 create-react-app 创建的应用程序中解析“react-native” - Realm and React error. Can't resolve 'react-native' in app created with create-react-app 尝试将 react-select 导入使用 create-react-app 创建的项目时出错 - Error trying to import react-select to a project created with create-react-app 然后尝试 create-react-app 时出错(npm ERR!cb() never call!然后尝试 create-react-app) - Error then trying create-react-app( npm ERR! cb() never called! then trying create-react-app) 世博项目的本机链接失败 - react-native link failing with expo project 在create-react-app中安装react项目时出现npm错误 - npm error when install react project in create-react-app 尝试在 create-react-app 项目中扩展 ESLint 的问题 - Issues trying to extend ESLint in a create-react-app project 在React-Native Expo中购买应用程序吗? - In App Purchases in React-Native Expo? 尝试将 create-react-app 项目部署到 Netlify - Trying to deploy a create-react-app project to Netlify 尝试解决有关 create-react-app 的错误 - Try to solve error about create-react-app 如何使用 Gatsby 和 create-react-app 添加 react-native out-of-tree 平台? - How to add react-native out-of-tree platforms using Gatsby and create-react-app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM