准备你的开发环境
准备好……
- 安装用于构建 Astro 网站的任何工具
获取你需要的开发工具
标题部分 获取你需要的开发工具¥Get the dev tools you need
终端
标题部分 终端¥Terminal
你将使用命令行(终端)创建 Astro 项目并运行关键命令来构建、开发和测试你的站点。
¥You will use a command line (terminal) to create your Astro project and to run key commands to build, develop, and test your site.
你可以通过操作系统的本地终端程序访问命令行。常见应用包括终端 (MacOS/Linux)、命令提示符 (Windows) 和 Termux (Android)。其中之一可能已经在你的计算机上。
¥You can access the command line through a local terminal program for your operating system. Common applications include Terminal (MacOS/Linux), Command Prompt (Windows), and Termux (Android). One of these will probably already be on your machine.
Node.js
标题部分 Node.js为了使 Astro 在你的系统上运行,你还需要安装兼容版本的 Node.js。Astro 支持偶数版本的 Node.js。目前支持的最低版本为:v18.20.8
、v20.3.0
和 v22.0.0
。(不支持 v19
和 v21
。)
¥For Astro to run on your system, you will also need to have a compatible version of Node.js installed. Astro supports even-numbered Node.js versions. The current minimum supported versions of each are: v18.20.8
, v20.3.0
, and v22.0.0
. (v19
and v21
are not supported.)
要检查你是否已安装兼容版本,请在终端中运行以下命令:
¥To check to see whether you already have a compatible version installed, run the following command in your terminal:
node -v
// Example outputv18.20.8
如果命令返回 Astro 支持的版本号,则表示你可以继续使用!
¥If the command returns a version number supported by Astro, you’re good to go!
如果命令返回错误消息(如 Command 'node' not found
)或版本号低于要求,则需要 安装兼容的 Node.js 版本。
¥If the command returns an error message like Command 'node' not found
, or a version number lower than the required, then you need to install a compatible Node.js version.
代码编辑器
标题部分 代码编辑器¥Code Editor
此外,你需要下载并安装代码编辑器来编写代码。
¥Additionally, you will need to download and install a code editor to write your code.
- Download and install VS Code or another code editor of your choice.
测试你的知识
标题部分 测试你的知识¥Test your knowledge
以下哪一项是…
¥Which of the following is…
- 代码编辑器,用于更改文件及其内容?
- 你的存储库的在线版本控制提供商?
- 用于运行命令的应用?
继续前进的清单
标题部分 继续前进的清单¥Checklist for moving on
资源
标题部分 资源¥Resources
-
FreeCodeCamp.org external — a free educational site with full courses or quick refreshers in HTML, CSS, JS, and more.