环境设置
发布时间:2026-09-25 | 浏览:1
要开始使用 Ionic 框架,唯一的要求是一个 Node & npm 环境。
🌐 To get started with Ionic Framework, the only requirement is a Node & npm environment.
当然,还需要一个代码编辑器。推荐使用 Visual Studio Code 。Visual Studio Code 是由微软制作的免费、功能齐全的文本编辑器。
🌐 Of course, a code editor is also required. Visual Studio Code is recommended. Visual Studio Code is a free, batteries-included text editor made by Microsoft.
大量的 Ionic 开发需要熟悉命令行。如果你对命令行不熟悉,请参阅 这篇博客文章 以快速入门。
一般来说,我们建议使用内置终端。许多第三方终端可以很好地与 Ionic 配合使用,但可能不受支持。
🌐 In general, we recommend using the built-in terminals. Many third-party terminals work well with Ionic, but may not be supported.
对于 Windows, 命令提示符 和 PowerShell 是支持的。 WSL 已知可以与 Ionic 一起使用,但可能不受支持。
对于 macOS,支持内置的 终端 应用。
Git Bash(来自 git-scm.com )不支持 TTY 交互,并且 不被 Ionic 支持。
几乎所有现代 JavaScript 项目的工具都基于 Node.js 。 下载页面 提供了适用于所有平台的预构建安装包。我们建议选择 LTS 版本以确保最佳兼容性。
🌐 Almost all tooling for modern JavaScript projects is based in Node.js . The download page has prebuilt installation packages for all platforms. We recommend selecting the LTS version to ensure best compatibility.
Node 打包了 npm ,这是 JavaScript 的包管理器。
🌐 Node is bundled with npm , the package manager for JavaScript.
要验证安装,请打开一个新的终端窗口并运行:
🌐 To verify the installation, open a new terminal window and run:
在 macOS 上使用 npm 安装全局包时,权限错误很常见。如果出现 EACCES 错误,请参阅 解决权限错误 。
虽然不是必需的,但强烈推荐使用版本控制系统 Git 。
🌐 Although not required, the version control system Git is highly recommended.
Git 通常会配合 Git 托管服务使用,例如 GitHub ,在这种情况下需要进行额外的设置。请按照 Git 托管服务文档中的教程来设置 Git:
🌐 Git is often accompanied by a Git Host, such as GitHub , in which case additional setup is required. Follow the tutorial from the Git Host's documentation to set up Git:
Bitbucket: 安装 Git
否则,请遵循 官方安装说明 。命令行工具可以从 下载页面 下载。
🌐 Otherwise, follow the official installation instructions . The command-line utility can be downloaded from the download page .
要验证安装,请打开一个新的终端窗口并运行:
🌐 To verify the installation, open a new terminal window and run:
Git 是一个命令行工具,但有许多 图形用户界面客户端 可用。 GitHub Desktop 是推荐的,并且与 GitHub 配合良好。
🌐 Git is a command-line utility, but there are many GUI clients available. GitHub Desktop is recommended, and works well with GitHub.