本站 - 开始
本指南将引导您如何在本地环境中快速启动、构建和预览本站。在开始之前,请确保您的电脑已经安装了以下必备环境:
- Node.js: 版本需为
^18.0.0或>=20.0.0。您可以从 Node.js 官网 下载安装。 - pnpm: 一个快速、高效的包管理工具。您可以通过
npm install -g pnpm进行全局安装,详情请参考 pnpm 官方文档。
下面我们从零开始,一步一步进行构建。
本地运行
VitePress 安装
在电脑本地硬盘上,创建一个新的项目目录,比如取名叫做 Teek,因为后面将会使用 Teek 这个主题。
pnpm add -D vitepressVitePress 附带一个命令行设置向导,可以帮助你构建一个基本项目。安装后,通过运行以下命令启动向导:
pnpm vitepress initTeek 安装
建议使用如下包管理器安装 vitepress-theme-teek:
pnpm install vitepress-theme-teek -D因为 Teek 还处于开发过程当中,近期会有频繁的版本升级。可以使用包管理命令进行升级:
pnpm up --latestTeek 引入
根据 Vitepress 的要求,需要在 .vitepress/theme/index.ts 文件中引入 Teek 主题。如果没有该路径,需要先创建它:
import Teek from "vitepress-theme-teek";
import "vitepress-theme-teek/index.css";
export default {
extends: Teek,
};然后在 .vitepress/config.ts 文件中引入 Teek 的配置信息:
// .vitepress/config.ts
import { defineConfig } from "vitepress";
import { defineTeekConfig } from "vitepress-theme-teek/config";
// Teek 主题配置
const teekConfig = defineTeekConfig({});
// Vitepress 配置
export default defineConfig({
extends: teekConfig,
// ...
});启动运行
下一步,就可以在 docs 根目录下构建包含源文件的各级目录了。如果你之前使用过 VuePress 或 VitePress,直接复制你旧项目内 docs 下的源文件目录,然后进行粘贴即可。
使用以下命令运行它:
pnpm run docs:dev命令成功运行后,您会在终端看到类似下面的输出:
vitepress v1.6.3
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help现在,您可以在浏览器中打开 http://localhost:5173/ 地址,开始对本地站点进行访问和预览了。
远程推送
这里介绍如何将本地项目仓库推送至 GitHub 的远程仓库。
Vercel 部署
这里介绍如何在 Vercel 创建新一个新项目,并从 GitHub 拉取仓库内容,生成静态站点
EdgeOne 部署
先登录腾讯云,然后通过控制台登录:
访问 边缘安全加速平台 EO 控制台 进行登录。
It looks like your build actually succeeded, but the deployment failed at the very last step. According to the logs, VitePress finished rendering, the static files were collected and uploaded, and the process failed only during the "Deploying outputs" phase.
The specific error Deployment failed: Create EdgeLess BU failed is an internal Tencent EdgeOne error, likely related to how the platform is trying to provision the edge computing resources (EdgeLess) for your static site.
💡 The Diagnosis
- Build vs. Deployment: Your code is fine. The log
✓ rendering pages... build complete in 38.13sconfirms that your VitePress site is building correctly. - The "BU" Error: In Tencent Cloud terminology, "BU" often refers to a Business Unit or a specific resource container. "Create EdgeLess BU failed" suggests the platform's backend failed to initialize the edge nodes that should serve your files.
🛠️ Step-by-Step Debugging
1. Check for Config File Conflicts
The log shows: [cli] No server-handler detected, generating routes.json for pure project.... If you have a custom edgeone.config.json or a routes.json in your repository that you haven't updated in a while, it might be clashing with the new builder version (20260305).
- Action: Try temporarily renaming any EdgeOne-specific config files in your root directory and let the platform auto-generate them to see if it clears the error.
2. Verify Output Directory
The log says: OutputDir: docs/.vitepress/distTarget: .../.edgeone/assets
- Action: Ensure that in the Tencent EdgeOne console, your Output Directory setting matches
docs/.vitepress/dist. If you recently moved your docs into a subdirectory or changed the VitePress config, the platform might be looking in the wrong place for the entry point.
3. Dependency Warnings (The "pnpm" issue)
You have a warning early in the logs: Ignored build scripts: @parcel/watcher, esbuild. While this rarely causes a "Deployment Failed" error, it can lead to missing features in the build.
- Action: If the deployment continues to fail, try adding a
pnpm-workspace.yamlor updating yourpackage.jsonto allow these scripts, asesbuildis often crucial for Vite-based tools like VitePress.
4. Check Platform Quotas/Status
Since the error is "Create EdgeLess BU failed," this is often an infrastructure issue on Tencent's side.
- Action: * Check if you have reached the limit of "Pages" projects on your account.
- Check the Tencent Cloud Status page for any incidents related to EdgeOne or Edge Functions.
5. Force a Fresh Environment
Sometimes the "Build Unit" (BU) fails because of a corrupted cache in the environment.
- Action: Go to the EdgeOne Pages console, find your project, and look for an option to "Redeploy" with "Clear Cache" enabled.
🔍 Specific Red Flag in your Log
I noticed these lines: '/dev/shm/repo/.../docs/03.Editor' 路径不存在 (Path does not exist)'/dev/shm/repo/.../docs/08.Frontend' 路径不存在 (Path does not exist)
While the build finished, these missing paths might be causing the auto-generated routes.json to reference directories that don't exist, which could crash the deployment engine when it tries to map the edge routes.
克隆或拉取
如何快速将位于远程仓库的项目快速部署到新的电脑。