[GUIDE/FIX] installing on M1 (Apple Silicon) Macs: npm ERR! sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8
See original GitHub issueHello there, first of all, thank you all for the contributions to this plugin. But I can’t install it on a M1 (Apple Silicon Mac), since one of the Dependencies has to be built manually to make this work.
The Problem
When executing npm install --save-dev @nuxt/image
I get the following error stack:
npm ERR! code 1
npm ERR! path /Users/fabian/Desktop/code/madebyfabian-com/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR! LIBTOOL-STATIC Release/nothing.a
npm ERR! TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR! CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-darwin-arm64v8.tar.br
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 https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.8.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.1 found at "/opt/homebrew/opt/python@3.9/bin/python3.9"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.9/bin/python3.9
and the package is not being installed.
Solution
- You have to install “libvps” globally on your mac system to get this plugin to work on your development machine.
- You need brew installed to do this.
Install gcc
The “libvps” depends on gcc, so do:
brew install --build-from-source gcc
Install XCode Build Tools CLI
Also required by “libvps”
xcode-select install
Install “vips”
brew install vips
Finally 🥳, install @nuxt/image
npm install --save-dev @nuxt/image
(or use yarn, if you want)
This solution works for me, but I am not an expert in all these dependencies, so if there is anything wrong, please correct it. I would suggest leaving this Issue open until e.g. the dependency get’s updated and supports M1 Macs out of the box, so that anyone having the same problem can search and find this issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:54
- Comments:14 (3 by maintainers)
Top Results From Across the Web
How to fix “ERR! sharp Prebuilt libvips 8.10.5 binaries are not ...
If Npm has not been installed through nvm run these command lines and install a version compatible with Apple Silicon M1 devices (here...
Read more >sharp Prebuilt libvips 8.10.5 binaries are not yet available for ...
In node js I am installing all package.json dependencies using yarn install command in mac. my node version is 12.0.0.
Read more >Fixing npm install on an M1 Mac - AJ's Blog
And the reason the install is failing is because "Prebuilt libvips 8.9.1 binaries are not yet available for darwin-arm64v8" and "fatal error: ' ......
Read more >Sharp error mac m1 - nvh95 Handbook
When running command yarn to install dependencies for a Gatsby project on Mac M1, I encounter this error with sharp:
Read more >Mac computers with Apple silicon
MacBook Pro (13-inch, M1, 2020). On Mac computers with Apple silicon, About This Mac shows an item labeled Chip, followed by the name...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
According to https://github.com/nuxt/image/issues/204#issue-837103392 and https://www.powerlifting.stream/posts/gatsby-m1/, I solved it by installing vips using homebrew:
Thanks for the guide. I’m closing as this should now be fine since sharp
0.28.0
- see https://sharp.pixelplumbing.com/install#apple-m1.