跳转到内容

找不到 Sharp。

MissingSharp:找不到 Sharp。请手动将 Sharp (sharp) 安装到你的项目中,或迁移到其他图像服务。

Sharp 是 astro:assets 使用的默认图像服务。当使用像 pnpm 这样的严格包管理器时,必须手动将 Sharp 安装到你的项目中才能使用图像处理。

如果你不使用 astro:assets 进行图像处理,并且不希望安装 Sharp,你可以配置以下不进行任何处理的直通图像服务

import { defineConfig, passthroughImageService } from "astro/config";
export default defineConfig({
image: {
service: passthroughImageService(),
},
});

另请参阅

贡献 社区 赞助