developer-portal-starter
developer-portal-starter copied to clipboard
Running Redocly locally on Mac M1
Hi,
I get get the following errors when running yarn start
on my Macbook Air with M1 processor:
Error: Something went wrong installing the "sharp" module
dlopen(/Users/***/src/external-documentation/node_modules/@redocly/gat sby-plugin-sharp/node_modules/sharp/build/Release/sharp.node, 1): Symbol not f ound: __ZTVN4vips7VOptionE
Referenced from: /Users/fredrikryde/src/external-documentation/node_modules/ @redocly/gatsby-plugin-sharp/node_modules/sharp/build/Release/sharp.node
Expected in: flat namespace
in /Users/fredrikryde/src/external-documentation/node_modules/@redocly/gatsby -plugin-sharp/node_modules/sharp/build/Release/sharp.node
- Remove the "node_modules/sharp" directory then run
"npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/in stall
- Search for this error at https://github.com/lovell/sharp/issues
I followed the steps above but with no success. My guess is it has something to do with my new M1 Mac
Running Node 14.15.4
Any help would be much appreciated .
I apologize -- I hadn't seen this earlier. Is this issue still ongoing?
Sharp is a real amazing library and a real challenge too. Let us see if anyone on our team already has an M1, or if we can find some info about sharp/M1 compatibility...
Hey @RoughRyde, since beta.120 version of developer portal we disabled image optimizations by default in the portal and made sharp an optional dependency. You may still see the error installing it but it should continue to work.
You can also use yarn install --ignore-optional
.
I almost justified buying the M1.

Even with yarn install --ignore-optional
installing won't work on a M1; see above screenshot
Once libvips
is installed globally however, there is no issue. Recently added to the Sharp docs: https://sharp.pixelplumbing.com/install#apple-m1
Most easy way to do this is via Brew, with the command brew install vips
. So, for the developer portal this step should come before yarn install
for M1 users. Tested and working.
P.S. @adamaltman I would still get that M1 ;)
Someone has reported a workaround using the brew install vips
you suggested (thanks @MarcoDeJong ):
brew install vips
rm -rf ./node_modules
yarn cache clean
yarn
Having the same issue on a MacBook Pro M1. The workaround with brew install vips
fails for me due to a vips open-mpi dependency.
Feels like a rabbit hole. Any suggestions?
That is more related to your local environment, then the developer portal.
Your brew or any formula is probably outdated. Run brew update
then check brew doctor
or brew outdated
I was struggling with a similar error, but was on the yarn install
step, and found that downgrading from node16 to node14 fixed my issue for me.
This worked w/ node 16.14.0 && "@redocly/developer-portal": "1.1.0-beta.85"
brew install vips rm -rf ./node_modules yarn install