Skip to content

libvps issue in electron app #3250

@Stanzilla

Description

@Stanzilla

Possible install-time or require-time problem

  • I have read the documentation relating to installation.
  • I have ensured that the architecture and platform of Node.js used for npm install is the same as the architecture and platform of Node.js used at runtime.

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of sharp that is not the latest, please open an issue against that package instead.

Is this a problem with filesystem permissions?

If you are using npm v6 or earlier and installing as a root or sudo user, have you tried with the npm install --unsafe-perm flag?

If you are using npm v7 or later, does the user running npm install own the directory it is run in?

If you are using the ignore-scripts feature of npm, have you tried with the npm install --ignore-scripts=false flag?

What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?

Details

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

I sadly can't test this because I don't have an M1 mac so I have to rely on user reports. When building the app in GitHub CI on a non M1 system, generating a universal build like this the user reports the following error on launch:

/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Resources/app.asar/node_modules/sharp/lib/sharp.js:31 Uncaught Error: 
Something went wrong installing the "sharp" module

dlopen(/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node, 0x0001): Library not loaded: @rpath/libvips-cpp.42.dylib
  Referenced from: /private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/sharp-darwin-arm64v8.node
  Reason: tried: '/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/../.././vendor/8.12.2/darwin-arm64v8/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Resources/app.asar.unpacked/node_modules/sharp/build/Release/../.././vendor/8.12.2/darwin-arm64v8/lib/libvips-cpp.42.dylib' (no such file), '/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libvips-cpp.42.dylib' (no such file), '/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Frameworks/WeakAuras Companion Helper (Renderer).app/Contents/MacOS/../../../libvips-cpp.42.dylib' (no such file), '/usr/local/lib/libvips-cpp.42.dylib' (no such file), '/usr/lib/libvips-cpp.42.dylib' (no such file)

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> (/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Resources/app.asar/node_modules/sharp/lib/sharp.js:31:9)
    at Object.<anonymous> (/private/var/folders/68/70njwxb92wj7k4_2fbvm2qwm0000gn/T/AppTranslocation/C21FFB40-AB14-4498-AC48-0D03B45E1171/d/WeakAuras Companion.app/Contents/Resources/app.asar/node_modules/sharp/lib/sharp.js:34:3)
    at Module._compile (node:internal/modules/cjs/loader:1118:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at i._load (node:electron/js2c/renderer_init:33:356)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions