Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check sharp module already loaded #2918

Merged
merged 2 commits into from
Oct 17, 2021
Merged

check sharp module already loaded #2918

merged 2 commits into from
Oct 17, 2021

Conversation

dkrnl
Copy link
Contributor

@dkrnl dkrnl commented Oct 6, 2021

Hi!
More readable error if sharp already loaded in peer deps.

e.g.:

test.js

const favicons = require('favicons'); 
const sharp = require('sharp');

output:

node ./test.js

Something went wrong installing the "sharp" module

The specified procedure could not be found.
\\?\/home/sharp-something-wrong/node_modules/sharp/build/Release/sharp-win32-x64.node

Possible solutions:
- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
- Install for the current runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
- Module already loaded in: /home/sharp-something-wrong/node_modules/favicons/node_modules/sharp/build/Release/sharp.node

npm ls sharp

@lovell
Copy link
Owner

lovell commented Oct 6, 2021

Hi, thank you for this PR, it will definitely make a useful addition to the help.

Please can you make this Windows only, and perhaps modify the solution message to read something like "Ensure version aligns with".

@dkrnl
Copy link
Contributor Author

dkrnl commented Oct 6, 2021

Ok. fixed.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 2ea9a3e on dkrnl:master into f37ca82 on lovell:master.

@lovell lovell merged commit e475d9e into lovell:master Oct 17, 2021
@lovell
Copy link
Owner

lovell commented Oct 17, 2021

Thank you!

@lovell lovell added this to the v0.29.2 milestone Oct 17, 2021
lovell added a commit that referenced this pull request Oct 17, 2021
martinj pushed a commit to aptoma/sharp that referenced this pull request Mar 31, 2022
martinj pushed a commit to aptoma/sharp that referenced this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants