This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
创建项目
了解如何创建新的 Expo 项目。
Expo 是一个 React Native 框架,使开发 Android 和 iOS 应用更容易。我们的框架提供基于文件的路由、原生模块的标准库,以及更多功能。Expo 是开源的,并且在 GitHub 和 Discord 上有活跃的社区。
🌐 Expo is a React Native framework that makes developing Android and iOS apps easier. Our framework provides file-based routing, a standard library of native modules, and much more. Expo is open source with an active community on GitHub and Discord.
我们还提供 Expo 应用服务 (EAS),一套在开发过程的每个步骤中补充 Expo 框架的服务。
🌐 We also make Expo Application Services (EAS), a set of services that complement the Expo framework in each step of the development process.
信息 编程新手? 你可以通过提示 AI 编程代理来构建你的第一个 Expo 应用,而不必编写代码。请参阅 使用 AI 构建教程。它涵盖了从零开始的设置。
系统要求
🌐 System requirements
- Node.js(长期支持版)。
- 支持 macOS、Windows(Powershell 和 WSL 2)以及 Linux。
从默认项目开始
🌐 Start with a default project
我们建议从 create-expo-app 创建的默认项目开始。默认项目包含示例代码,以帮助你入门。
🌐 We recommend starting with the default project created by create-expo-app. The default project includes example code to help you get started.
要创建新项目,请运行以下命令:
🌐 To create a new project, run the following command:
- npx create-expo-app@latest --template default@sdk-57注意: 在 SDK 57 过渡期间,不带
--template标志的create-expo-app@latest会创建一个 SDK 54 项目。如果你计划在实体设备上使用 Expo Go,请使用 SDK 54 项目。否则,使用--template default@sdk-57创建一个 SDK 57 项目。你也可以通过添加--template选项 来选择不同的模板。
从一个例子开始
🌐 Start from an example
你可以不使用默认项目,而是从其中一个 Expo 示例 开始。这些都是小型应用,每个示例演示一个特定的功能或集成,例如 Expo Router、Expo Widgets 或摄像头界面。
🌐 Instead of the default project, you can start from one of the Expo examples. These are small apps that each demonstrate a specific feature or integration, such as Expo Router, Expo Widgets, or a camera screen.
要浏览完整列表并互动地选择一个,请运行 create-expo-app 并使用 --example 选项且不指定名称:
🌐 To browse the full list and pick one interactively, run create-expo-app with the --example option and no name:
- npx create-expo-app@latest --example要直接创建一个已知示例,请传入其名称:
🌐 To create a known example directly, pass its name:
- npx create-expo-app@latest --example with-widgets信息 本 “入门” 部分的其余指南遵循默认项目。示例应用可能组织方式不同,但概念是相同的。
下一步
🌐 Next step
你有一个项目。现在是时候设置你的开发环境,以便你可以开始开发了。
🌐 You have a project. Now it's time to set up your development environment so that you can start developing.