[ERROR] Unable to build website for locale zh-Hans.[ERROR] Error: Docusaurus found broken links!
用npm run build 命令构建一个Docusaurus网站时遇到了错误。[ERROR] Unable to build website for locale zh-Hans.[ERROR] Error: Docusaurus found broken links!
项目场景:
用npm run build 命令构建一个Docusaurus网站时遇到了错误。[ERROR] Unable to build website for locale zh-Hans.[ERROR] Error: Docusaurus found broken links!
问题描述
[ERROR] Unable to build website for locale zh-Hans.
[ERROR] Error: Docusaurus found broken links!
Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.
Exhaustive list of all broken links found:
- On source page path = /docs/11/网络API接口设计:
-> linking to ../%E7%95%AA%E5%A4%96%E7%AF%87/%E6%96%B9%E5%A4%A9%E4%B8%8B%EF%BC%88%E7%A7%9F%E6%88%BF%E9%A1%B9%E7%9B%AE%EF%BC%89%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3.md (resolved as: /docs/%E7%95%AA%E5%A4%96%E7%AF%87/%E6%96%B9%E5%A4%A9%E4%B8%8B%EF%BC%88%E7%A7%9F%E6%88%BF%E9%A1%B9%E7%9B%AE%EF%BC%89%E6%8E%A5%E5%8F%A3%E6%96%87%E6%A1%A3.md)
- On source page path = /docs/11/MySQL性能优化:
-> linking to ../Day36-40/36-38.%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93MySQL.md (resolved as: /docs/Day36-40/36-38.%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93MySQL.md)
- On source page path = /docs/6/Web基础:
-> linking to ../%E7%8E%A9%E8%BD%ACPyCharm.md (resolved as: /docs/%E7%8E%A9%E8%BD%ACPyCharm.md)
- On source page path = /docs/9/并发下载:
-> linking to ../Day01-15/Day13/%E8%BF%9B%E7%A8%8B%E5%92%8C%E7%BA%BF%E7%A8%8B.md (resolved as: /docs/Day01-15/Day13/%E8%BF%9B%E7%A8%8B%E5%92%8C%E7%BA%BF%E7%A8%8B.md)
- On source page path = /docs/9/存储数据:
-> linking to ./02.%E6%95%B0%E6%8D%AE%E9%87%87%E9%9B%86%E5%92%8C%E8%A7%A3%E6%9E%90.md (resolved as: /docs/9/02.%E6%95%B0%E6%8D%AE%E9%87%87%E9%9B%86%E5%92%8C%E8%A7%A3%E6%9E%90.md)
-> linking to ../Day36-40/NoSQL%E5%85%A5%E9%97%A8.md (resolved as: /docs/Day36-40/NoSQL%E5%85%A5%E9%97%A8.md)
- On source page path = /docs/9/解析动态内容:
-> linking to ../Day01-15/Day11/%E6%96%87%E4%BB%B6%E5%92%8C%E5%BC%82%E5%B8%B8.md (resolved as: /docs/Day01-15/Day11/%E6%96%87%E4%BB%B6%E5%92%8C%E5%BC%82%E5%B8%B8.md)
- On source page path = /:
-> linking to /docs
at throwError (C:\Users\86150\Desktop\demo\document\node_modules\@docusaurus\logger\lib\index.js:76:11)
at handleBrokenLinks (C:\Users\86150\Desktop\demo\document\node_modules\@docusaurus\core\lib\server\brokenLinks.js:153:47)
at async buildLocale (C:\Users\86150\Desktop\demo\document\node_modules\@docusaurus\core\lib\commands\build.js:186:5)
at async tryToBuildLocale (C:\Users\86150\Desktop\demo\document\node_modules\@docusaurus\core\lib\commands\build.js:41:20)
at async mapAsyncSequential (C:\Users\86150\Desktop\demo\document\node_modules\@docusaurus\utils\lib\jsUtils.js:34:24)
at async Command.build (C:\Users\86150\Desktop\demo\document\node_modules\@docusaurus\core\lib\commands\build.js:76:21)
原因分析:
构建一个Docusaurus网站时遇到了错误。文档页面中存在损坏的链接。这些损坏的链接是指向不存在路径的引用,导致构建过程失败。主要的错误是[ERROR] Error: Docusaurus found broken links!
解决方案:
1. 检查损坏的链接:在文档中找到损坏的链接
2. 修复链接路径:修正损坏链接的路径。确保链接的路径是有效的。
3. 保存:修改好后保存代码重新执行npm run build 命令即可
- On source page path = /:
-> linking to /docs
上面这个错误信息的路径一般不在文档里面,而是需要在项目的index.js文件里面修改。将指向 /docs 的链接修改为正确的链接路径。如果文档页面位于 /docs 目录下,则可以将链接修复为 /docs 目录下的一个特定页面。
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)