Apple Silicon MacでGatsbyJSをビルド


gatsby new で darwin-arm64v8 向け libvips が利用できないエラーが発生する。

% npm install gatsby-cli
% npx gatsby new gatsby-blog
npm ERR! ERR! sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8
npm ERR! info sharp Attempting to build from source via node-gyp but this may fail due to the above error
npm ERR! info sharp Please see for required dependencies

対策: homebrew で libvips をインストール

% brew intall vips

% npx gatsby new gatsby-blog
Cloning into 'gatsby-blog'...
remote: Enumerating objects: 41, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 41 (delta 1), reused 24 (delta 0), pack-reused 0
Receiving objects: 100% (41/41), 1.24 MiB | 9.26 MiB/s, done.
success Created starter directory layout
info Installing packages...

added 2475 packages, and audited 2476 packages in 19s

info Initialising git in gatsby-blog

Your new Gatsby site has been successfully bootstrapped. Start developing it by running:

  cd gatsby-blog
  gatsby develop



Homebrew Formula - vips

Qiita - @yudwig - 2020-12-17 - Apple Silicon(M1)搭載MacでGatsbyJSをビルドする