Skip to content

准备你的开发环境

准备好……

  • 安装用于构建 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.

为了使 Astro 在你的系统上运行,你还需要安装兼容版本的 Node.js。Astro 支持偶数版本的 Node.js。目前支持的最低版本为:v18.20.8v20.3.0v22.0.0。(不支持 v19v21。)

¥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 output
v18.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.

  1. Download and install VS Code or another code editor of your choice.

¥Test your knowledge

以下哪一项是…

¥Which of the following is…

  1. 代码编辑器,用于更改文件及其内容?
  1. 你的存储库的在线版本控制提供商?
  1. 用于运行命令的应用?

¥Checklist for moving on

¥Resources

  • FreeCodeCamp.org external — a free educational site with full courses or quick refreshers in HTML, CSS, JS, and more.

Astro v5.8 中文网 - 粤ICP备13048890号