question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron based app build failing to install latest version of sharp correctly

See original GitHub issue

This is the error that shows up in my app Nostlan that uses Electron v11.2.3. It’s not including libvips in the build. Why not?

Uncaught (in promise) Error: 
Something went wrong installing the "sharp" module

dlopen(/var/folders/vd/w9__42kd42b9q2x6pcy9qdmm0000gn/T/.com.qashto.nostlan.KDHkI1, 1): Library not loaded: /usr/local/opt/vips/lib/libvips-cpp.42.dylib
  Referenced from: /var/folders/vd/w9__42kd42b9q2x6pcy9qdmm0000gn/T/.com.qashto.nostlan.KDHkI1
  Reason: image not found

- 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/install
- Search for this error at https://github.com/lovell/sharp/issues

    at Object.<anonymous> (/Applications/nostla…b/constructor.js:34)
    at Object.<anonymous> (/Applications/nostla…/constructor.js:387)
    at Module._compile (internal/modules/cjs/loader.js:1152)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173)
    at Module.load (internal/modules/cjs/loader.js:992)
    at Module._load (internal/modules/cjs/loader.js:885)
    at Function.f._load (electron/js2c/asar_bundle.js:5)
    at Module.require (internal/modules/cjs/loader.js:1032)
    at require (internal/modules/cjs/helpers.js:72)
    at Object.<anonymous> (/Applications/nostla…harp/lib/index.js:3)
    ```

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lovellcommented, Apr 22, 2021

You’ll either need to npm install --build-from-source in the first place or remove node_modules/sharp/vendor after running npm install if you’re later planning to use npm rebuild --build-from-source

0reactions
quinton-ashleycommented, Apr 22, 2021

oooooh thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron app says Sharp did not install correctly when calling ...
In a new electron project: Install Sharp with npm install sharp; Place provided code sample index.html; Create a new folder called images and ......
Read more >
Electron failed to install correctly, please delete node_modules
Solved this exact issue by understanding that I had both local and global installation of electron with different versions, npm install -g ...
Read more >
Things I Wish I Knew Before Working with Electron.js
In this article, I'll share how you can avoid some of the mistakes I made when learning about Electron.js ?‍♂️. I hope it...
Read more >
Quick Start | Electron
This guide will step you through the process of creating a barebones Hello World app in Electron, similar to electron/electron-quick-start.
Read more >
failed to construct transformer: error: failed to start watch mode.
Error: Electron failed to install correctly, please delete ... Make sure you have the latest version of node.js and npm installed. npm ERR!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found