pengzhanbo / vuepress-theme-plume

A vuepress theme. Simple, feature-rich, document & blog
https://theme-plume.vuejs.press
MIT License
115 stars 33 forks source link

[Bug]从plume-1.0.0-rc.112升级至plume-1.0.0-rc.113后,使用dev指令运行后提示Preprocessor dependency "sass-embedded" not found. Did you install it? Try `pnpm add -D sass-embedded`. #315

Open QiHuang02 opened 3 hours ago

QiHuang02 commented 3 hours ago

检查清单

包名

vuepress-theme-plume

你正在使用哪个操作系统?

描述该错误

网页上的提示 at loadPreprocessorPath (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:37291:13) at loadSassPackage (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:37306:19) at process (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:37552:27) at compileCSSPreprocessors (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:36741:34) at compileCSS (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:36795:38) at async TransformPluginContext.transform (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:36170:11) at async PluginContainer.transform (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:49096:18) at async loadAndTransform (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:51929:27) at async viteTransformMiddleware (file:///D:/.QiHuang02/locale/nodemodules/.pnpm/vite@5.4.10@types+node@22.8.1/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:61881:24 然后我去pnpm-lock发现有sass-embedded: image 然后是node_modules中没有sass: image

附加上下文

No response

pengzhanbo commented 2 hours ago

然后我去pnpm-lock发现有sass-embedded:

这里的截图只是描述了 主题包需要依赖 sass-embedded

然后是node_modules中没有sass:

sass 和 sass-embedded 都是可选依赖,但是需要二选一,至少有一个。

pnpm 包管理器有时候在处理一些 依赖的变更时,会出现一些问题,特别是在对 二进制依赖包的处理上。

但这类问题都比较好解决,你可以尝试按以下步骤解决:

  1. 运行 pnpm add -D sass-embedded , 安装后运行重新执行 dev 命令后查看是否还有报错;
  2. 如果上述步骤没有解决问题,那么直接暴力删除 pnpm-lock.yaml 和 node_modules ,然后执行 pnpm i 重新安装依赖。 安装后运行重新执行 dev 命令
QiHuang02 commented 2 hours ago

好的,已经解决了,感谢你的帮助