快速开始Installation

安装指南

前置要求

在开始之前,请确保你已经安装了以下软件:

  • Node.js 16.8 或更高版本
  • npm 或 yarn 或 pnpm

安装步骤

  1. 创建新项目:
npx create-next-app@latest my-docs
  1. 安装 Nextra:
npm install nextra nextra-theme-docs
  1. 通过更新 next.config.js 配置你的项目:
const withNextra = require('nextra')({
  theme: 'nextra-theme-docs',
  themeConfig: './theme.config.jsx'
})
 
module.exports = withNextra()
  1. 启动开发服务器:
npm run dev

你的文档网站现在应该在 http://localhost:3000 运行了!