升级 Docusaurus
¥Upgrading Docusaurus
Docusaurus 版本控制基于 major.minor.patch
方案并遵循 语义版本控制。
¥Docusaurus versioning is based on the major.minor.patch
scheme and respects Semantic Versioning.
重大更改仅在主要版本升级时发布,并在以下升级指南中详细记录。
¥Breaking changes are only released on major version upgrades, and thoroughly documented in the following upgrade guides.
📄️ 至 Docusaurus v3
upgrading-to-docusaurus-v3}
🗃️ 至 Docusaurus v2
5 items
升级故障排除
¥Troubleshooting upgrades
升级 Docusaurus 时,你可能会遇到由缓存依赖不匹配导致的问题 - 在报告错误或寻求支持之前,你应该执行一些故障排除步骤来解决这些常见问题。
¥When upgrading Docusaurus you may experience issues caused by mismatching cached dependencies - there are a few troubleshooting steps you should perform to resolve these common issues before reporting a bug or seeking support.
运行 clear
命令
¥Run the clear
command
此 CLI 命令用于清除 Docusaurus 站点生成的资源、缓存和构建工件。
¥This CLI command is used to clear a Docusaurus site's generated assets, caches and build artifacts.
- npm
- Yarn
- pnpm
npm run clear
yarn clear
pnpm run clear
删除 node_modules
和你的锁定文件
¥Remove node_modules
and your lock file(s)
使用以下命令删除 node_modules
文件夹和包管理器的锁定文件:
¥Remove the node_modules
folder and your package manager's lock file using the following:
- Bash
- PowerShell
rm -rf node_modules yarn.lock package-lock.json
@('node_modules','yarn.lock','package-lock.json') | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
然后重新安装软件包并使用以下命令重新生成 lock
文件:
¥Then reinstall packages and regenerate the lock
file using:
- npm
- Yarn
- pnpm
npm install
yarn install
pnpm install