Sharp error on yarn develop

System Information
  • Strapi Version: 4.13.6
  • Operating System: Mac OS Ventura Version 13.5.2 (22G91)
  • Database: better-sqlite3 8.0.1
  • Node Version: v18.17.1
  • NPM Version: 9.6.7
  • Yarn Version: 1.22.19

I just upgraded one of my projects that was running fine to the latest version of Strapi, and I got the following error:

yarn run v1.22.19
$ strapi develop
Building your admin UI with development configuration...
Admin UI built successfully
Error: Could not load js config file /Users/sohailhasware/GitHub/scrumhr/backend/node_modules/@strapi/plugin-upload/strapi-server.js: 
Something went wrong installing the "sharp" module

I even started a new blank project and got the same error.

I tried to follow the steps that @Eventyret suggested to brew install vips and then delete,

    • node_modules
  • build
  • .cache
  • package-lock.json or yarn.lock

Still having the same issue, should I delete node from system completely, and also uninstall node via brew or both and then reinstall.

Please help