You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you ensured 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?
Yes
Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?
Yes
What is the complete output of running npm install --verbose sharp? Have you checked this output for useful error messages?
What is the output of running npx envinfo --binaries --system?
Then I went into "/src" folder and did yarn add sharp and the output was :
yarn add v1.22.10
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ sharp@0.28.3
info All dependencies
└─ sharp@0.28.3
$ yarn electron-rebuild
yarn run v1.22.10
$ node -r ../.erb/scripts/BabelRegister.js ../.erb/scripts/ElectronRebuild.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
⠏ Building modules: 0/1gyp info find Python using Python version 3.9.6 found at "/usr/local/opt/python@3.9/bin/python3.9"
⠋ Building modules: 0/1gyp http GET https://www.electronjs.org/headers/v11.0.1/node-v11.0.1-headers.tar.gz
⠹ Building modules: 0/1gyp http 200 https://www.electronjs.org/headers/v11.0.1/node-v11.0.1-headers.tar.gz
⠹ Building modules: 0/1gyp http GET https://www.electronjs.org/headers/v11.0.1/SHASUMS256.txt
⠼ Building modules: 0/1gyp http 200 https://www.electronjs.org/headers/v11.0.1/SHASUMS256.txt
gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args '/Users/computerroom/Desktop/repos/sharp_test/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/computerroom/Desktop/repos/sharp_test/src/node_modules/sharp/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/computerroom/Desktop/repos/sharp_test/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/computerroom/Desktop/repos/sharp_test/src/node_modules/sharp/11.0.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/computerroom/Desktop/repos/sharp_test/src/node_modules/sharp/11.0.1',
gyp info spawn args '-Dnode_gyp_dir=/Users/computerroom/Desktop/repos/sharp_test/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/computerroom/Desktop/repos/sharp_test/src/node_modules/sharp/11.0.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/computerroom/Desktop/repos/sharp_test/src/node_modules/sharp',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
⠇ Building modules: 0/1gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
⠏ Building modules: 0/1 LIBTOOL-STATIC Release/nothing.a
⠋ Building modules: 0/1 TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
⠹ Building modules: 0/1 CXX(target) Release/obj.target/sharp/src/metadata.o
⠙ Building modules: 0/1 CXX(target) Release/obj.target/sharp/src/stats.o
⠏ Building modules: 0/1 CXX(target) Release/obj.target/sharp/src/operations.o
⠸ Building modules: 0/1 CXX(target) Release/obj.target/sharp/src/pipeline.o
⠴ Building modules: 0/1 CXX(target) Release/obj.target/sharp/src/utilities.o
⠏ Building modules: 0/1 CXX(target) Release/obj.target/sharp/src/sharp.o
⠹ Building modules: 0/1 SOLINK_MODULE(target) Release/sharp.node
✔ Rebuild Complete
✨ Done in 24.79s.
✨ Done in 46.48s.
Then went to src/App.tsx
imported Sharp and console.log(sharp.format);
Run yarn start
And it runs perfectly fine.
Then I run yarn package and it creates the release files. Then I went to the actual file and run the ElectronReact App in the mac folder.
Then it doesn't run properly and returns just the background.
Then I run a debugger on it using: ElectronReact.app/Contents/MacOS/ElectronReact --remote-debugging-port=8315
in terminal after cd into the folder.
In the console I get:
Something went wrong installing the "sharp" module
dlopen(/var/folders/sh/51kq204971b7dj984196l3880000gn/T/.org.erb.ElectronReact.9bczRx, 1): no suitable image found. Did find:
/var/folders/sh/51kq204971b7dj984196l3880000gn/T/.org.erb.ElectronReact.9bczRx: code signature in (/var/folders/sh/51kq204971b7dj984196l3880000gn/T/.org.erb.ElectronReact.9bczRx) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
/var/folders/sh/51kq204971b7dj984196l3880000gn/T/.org.erb.ElectronReact.9bczRx: stat() failed with errno=17
- Remove the "node_modules/sharp" directory then run
"npm install --ignore-scripts=false --verbose sharp" 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> (/Users/computerroom/Desktop/repos/sharp_test/release/mac/ElectronReact.app/Contents/Resources/app.asar/node_modules/sharp/lib/constructor.js:32)
at Object.<anonymous> (/Users/computerroom/Desktop/repos/sharp_test/release/mac/ElectronReact.app/Contents/Resources/app.asar/node_modules/sharp/lib/constructor.js:394)
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> (/Users/computerroom/Desktop/repos/sharp_test/release/mac/ElectronReact.app/Contents/Resources/app.asar/node_modules/sharp/lib/index.js:3)
So I am facing this issue with sharp in the packaged project, but in dev it is working fine.
The reproduced error is in the project: https://github.com/sarang-apps/sharp_test
I also have libvips installed on my computer so there are no issues with that.
The text was updated successfully, but these errors were encountered:
Pre checks
Did you see the documentation relating to installation?
Yes
Have you ensured 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?Yes
Are you using the latest version? Is the version currently in use as reported by
npm ls sharp
the same as the latest version as reported bynpm view sharp dist-tags.latest
?Yes
What is the complete output of running
npm install --verbose sharp
? Have you checked this output for useful error messages?What is the output of running
npx envinfo --binaries --system
?Steps to Reproduce Issue
I used this template:
https://github.com/electron-react-boilerplate/electron-react-boilerplate
and created a repo:
https://github.com/sarang-apps/sharp_test
Then I went into "/src" folder and did
yarn add sharp
and the output was :yarn start
yarn package
and it creates the release files. Then I went to the actual file and run the ElectronReact App in the mac folder.ElectronReact.app/Contents/MacOS/ElectronReact --remote-debugging-port=8315
in terminal after cd into the folder.
So I am facing this issue with sharp in the packaged project, but in dev it is working fine.
The reproduced error is in the project:
https://github.com/sarang-apps/sharp_test
I also have libvips installed on my computer so there are no issues with that.
The text was updated successfully, but these errors were encountered: