ATQQ / sugar-blog

✍️📚我写博客的地方🤪🤪🤪记录随笔与学习笔记,仓库包含:博客内容,博客主题、博客模板、vitepress离线全文搜索插件、VitePress RSS 支持插件;a blog theme use vitepress

Home Page:https://sugarat.top

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

打包会出现问题

Strive-Wxffff opened this issue · comments

'pagefind' is not recognized as an internal or external command,
operable program or batch file.
build error:
Error: Command failed: npx pagefind --source docs.vitepress\dist --exclude-selectors "div.aside, a.header-anchor"
at checkExecSyncError (node:child_process:885:11)
at execSync (node:child_process:957:15)
at vitepressConfig.buildEnd (F:\vitepress\my-blog\node_modules.pnpm@sugarat+theme@0.1.37_vitepress@1.0.0-beta.5_vue@3.3.4\node_modules@sugarat\theme\node.js:329:49)
at build (file:///F:/vitepress/my-blog/node_modules/.pnpm/vitepress@1.0.0-beta.5_@algolia+client-search@4.19.1_sass@1.64.1_search-insights@2.7.0/node_modules/vitepress/dist/node/serve-d0f912b9.js:48768:59)
 ELIFECYCLE  Command failed with exit code 1.
大佬有空解决一下

commented

这个好像是window上的问题 pagefind好像有点不兼容,你看一下主题配置那块 ,把那个pagefind注释掉即可

.vitepress/config.ts

import { getThemeConfig, defineConfig } from '@sugarat/theme/node'

// 主题独有配置
// 详见文档: https://theme.sugarat.top/
const blogTheme = getThemeConfig({
  // 文章默认作者
  author: '粥里有勺糖',
  // 开启离线的全文搜索支持(如构建报错可注释下面的配置再次尝试)
  // search: 'pagefind'
})
commented

或者你可以试着在项目里安装pagefind,看看能不能成功

pnpm add pagefind