Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Running Redocly locally on Mac M1 #61

Open
RoughRyde opened this issue Feb 9, 2021 · 9 comments
Open

Running Redocly locally on Mac M1 #61

RoughRyde opened this issue Feb 9, 2021 · 9 comments

Comments

@RoughRyde
Copy link

RoughRyde commented Feb 9, 2021

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 .

@adamaltman
Copy link
Member

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...

@RomanHotsiy
Copy link
Member

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.

@adamaltman
Copy link
Member

I almost justified buying the M1.

@MarcoDeJong
Copy link

screenshot-error

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 ;)

@adamaltman
Copy link
Member

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

@pkwade
Copy link

pkwade commented Jun 28, 2021

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.

Screen Shot 2021-06-28 at 2 45 39 PM

Feels like a rabbit hole. Any suggestions?

@MarcoDeJong
Copy link

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

@stefprez
Copy link

stefprez commented Mar 4, 2022

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.

@wibobm
Copy link

wibobm commented Mar 20, 2022

This worked w/ node 16.14.0 && "@redocly/developer-portal": "1.1.0-beta.85"

brew install vips
rm -rf ./node_modules
yarn install

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants