antvis / gatsby-theme-antv

⚛️ Polished Gatsby theme for documentation site
https://gatsby-starter-theme-antv.antv.vision/zh
Other
344 stars 57 forks source link

fix: 修复 arm 芯片下 npm 安装 sharp 报错的问题 #371

Closed october-rain closed 2 years ago

october-rain commented 2 years ago

问题描述

M1mac 环境下使用 yarn install 会报错,提示 sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8

问题追溯

查看 sharp官网关于M1芯片的说明 后得知,0.29.x 版本才支持 ARM64

查看当前sharp版本

npm list sharp

@antv/gatsby-theme-antv@ /Users/shiyu/DCODE/gatsby-theme-antv
└─┬ @antv/gatsby-theme-antv@1.1.16 -> ./@antv/gatsby-theme-antv
  └─┬ gatsby-plugin-manifest@2.12.1
    └── sharp@0.27.2

gatsby-theme-antv 依赖 gatsby-plugin-manifest的第二个大版本,其中依赖的sharp被锁定在 0.27.x

解决方案

package.json 中,利用 resolutions 字段,将 sharp 版本锁定在 0.29.x 以上

github-actions[bot] commented 2 years ago

⚡️ Deploying PR Preview...