Closed october-rain closed 2 years ago
在 M1 的 mac 环境下使用 yarn install 会报错,提示 sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8
M1
mac
yarn install
sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8
查看 sharp官网关于M1芯片的说明 后得知,0.29.x 版本才支持 ARM64
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
gatsby-theme-antv
gatsby-plugin-manifest
0.27.x
在 package.json 中,利用 resolutions 字段,将 sharp 版本锁定在 0.29.x 以上
package.json
resolutions
sharp
⚡️ Deploying PR Preview...
问题描述
在
M1
的mac
环境下使用yarn install
会报错,提示sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8
问题追溯
查看 sharp官网关于M1芯片的说明 后得知,
0.29.x
版本才支持ARM64
查看当前sharp版本
gatsby-theme-antv
依赖gatsby-plugin-manifest
的第二个大版本,其中依赖的sharp被锁定在0.27.x
解决方案
在
package.json
中,利用resolutions
字段,将sharp
版本锁定在0.29.x
以上