npm error sharp: Installation error: aborted
MacOS Sonoma 14.4.1, Apple M3 Pro
sudo npm install -g cordova-res --unsafe-perm=true
npm error code 1 npm error path /usr/local/lib/node_modules/cordova-res/node_modules/sharp npm error command failed npm error command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm error sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.11.3/libvips-8.11.3-darwin-x64.tar.br npm error sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies npm error sharp: Installation error: aborted
npm error A complete log of this run can be found in...
=========================================
197 silly placeDep node_modules/cordova-res [email protected] OK for: [email protected] want: ^1.3.1
198 silly placeDep node_modules/cordova-res [email protected] OK for: [email protected] want: ^1.1.13
199 silly placeDep node_modules/cordova-res [email protected] OK for: [email protected] want: ^1.1.1
200 silly placeDep node_modules/cordova-res [email protected] OK for: [email protected] want: ^1.0.1
201 silly fetch manifest safe-buffer@~5.2.0
202 silly placeDep node_modules/cordova-res [email protected] OK for: [email protected] want: ~5.2.0
203 silly reify moves {}
204 info run [email protected] install node_modules/cordova-res/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
205 info run [email protected] install { code: 1, signal: null }
206 verbose stack Error: command failed
206 verbose stack at ChildProcess.
So, Any idea?
I'm having the same problem, please fix this
running solved the problem for me: npm install --ignore-scripts=false --foreground-scripts --verbose sharp --force
nothing has fixed it for me, tried installing the latest version using npm i sharp --saveDev, and running npm install --ignore-scripts=false --foreground-scripts --verbose sharp --force and npm install --cpu=arm64v8 --os=darwin sharp and npm install --cpu=arm64 --os=darwin sharp.
Nothing has made npx @capacitor/assets generate succeed on my m4 silicon:
npx @capacitor/assets generate
/Users/matthewharris/rtp/rtpSoftware/Ionic/BeerBargain/BeerBargainApp/node_modules/@capacitor/assets/node_modules/sharp/lib/sharp.js:37
throw new Error(help.join('\n'));
^
Error:
Something went wrong installing the "sharp" module
dlopen(/Users/matthewharris/rtp/rtpSoftware/Ionic/BeerBargain/BeerBargainApp/node_modules/@capacitor/assets/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node, 0x0001): tried: '/Users/matthewharris/rtp/rtpSoftware/Ionic/BeerBargain/BeerBargainApp/node_modules/@capacitor/assets/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/matthewharris/rtp/rtpSoftware/Ionic/BeerBargain/BeerBargainApp/node_modules/@capacitor/assets/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node' (no such file), '/Users/matthewharris/rtp/rtpSoftware/Ionic/BeerBargain/BeerBargainApp/node_modules/@capacitor/assets/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current darwin-arm64v8 runtime: "npm install --platform=darwin --arch=arm64v8 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
at Object.<anonymous> (/Users/matthewharris/rtp/rtpSoftware/Ionic/BeerBargain/BeerBargainApp/node_modules/@capacitor/assets/node_modules/sharp/lib/sharp.js:37:9)
at Module._compile (node:internal/modules/cjs/loader:1562:14)
at Object..js (node:internal/modules/cjs/loader:1699:10)
at Module.load (node:internal/modules/cjs/loader:1313:32)
at Function._load (node:internal/modules/cjs/loader:1123:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Module.require (node:internal/modules/cjs/loader:1335:12)
at require (node:internal/modules/helpers:136:16)
at Object.<anonymous> (/Users/matthewharris/rtp/rtpSoftware/Ionic/BeerBargain/BeerBargainApp/node_modules/@capacitor/assets/node_modules/sharp/lib/constructor.js:11:1)