If you’ve recently upgraded your device to Apple’s new M1 lineup, you may be encountering the following error when trying to create a new Gatsby project:
The key here is sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8.
As you can see, this is happening since the given binary is not yet supported for Apple’s new CPU architecture.
But you can go around this issue by compiling libvips from the source and install it globally first.
Sounds simple enough, right?
Well, I had to go through few more steps to accomplish it. I’ve compiled them all here in one place so you don’t have to waste time digging around:
Install Homebrew if you already haven’t
… and yes, it is M1 compatible!
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Xcode CLT
Make sure you first have Xcode itself from the Appstore installed, otherwise it may cause issues down the road.
Then run:
xcode-select --install
Install Vips
brew install vips
Done!
Now you can run Gatsby CLI as usual gatsby new project-name [repository link]
, and if everything went right, you should no longer see the dreaded error!