vuetom/vitepress-theme-vuetom

下载完成后报错什么原因

Closed this issue · 2 comments

Internal server error: Failed to resolve entry for package "vitepress-theme-vuetom". The package may have incorrect main/module/exports specified in its package.json.
主要是index.ts文件由问题但是不知道问题出现哪里

这个报错的文件位置会出现在 .vitepress/theme/index.ts 中
大概是这一行 import VuetomTheme from 'vitepress-theme-vuetom'

  1. 拉取该项目后直接 pnpm i 安装依赖并运行文档 pnpm dev:docs 命令后出现这个错误的话应该是 node 版本的问题
  2. 如果通过 npm 从远程仓库安装 vitepress-theme-vuetom 的话建议改为本地引用,也就是将 改为相对路径引用 (import VuetomTheme from '../../../vuetom/index') 或者使用 workspace (依赖"vitepress-theme-vuetom": "workspace:^2.2.0")

Internal server error: Failed to resolve entry for package "vitepress-theme-vuetom". The package may have incorrect main/module/exports specified in its package.json. 主要是index.ts文件由问题但是不知道问题出现哪里

如果报错发生在构建阶段,也就是 pnpm build:docs 时报错,那么需要先执行 pnpm build:theme,先 build 主题再 build 文档,这个忘记在文档里面说明一下了