返回文档列表

chapter02

环境配置

本章介绍如何配置开发环境。

Node.js 安装

macOS

# 使用 Homebrew 安装
brew install node@20

# 验证安装
node -v
npm -v

Windows

  1. 访问 Node.js 官网
  2. 下载 LTS 版本
  3. 运行安装程序

Linux

# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

Git 配置

# 配置用户信息
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

# 配置 SSH 密钥
ssh-keygen -t ed25519 -C "your.email@example.com"

编辑器推荐

  • VS Code:轻量级,插件丰富
  • WebStorm:功能强大,开箱即用
  • Neovim:高度可定制