Something went wrong installing the "sharp" module
See original GitHub issueDescription:
i’m use ionic cordova resources ios --force command if ionic-cli 5.0.2 will be error Something went wrong installing the “sharp” module but ionic-cli 4.12.0 is ok
Steps to Reproduce:
Output:
D:\WEB\ConsentApp>ionic cordova resources ios --force
cordova-res.cmd ios [cordova-res] [cordova-res] Something went wrong installing the “sharp” module [cordova-res] [cordova-res] The specified module could not be found. [cordova-res] \?\D:\WEB\ConsentApp\node_modules\sharp\build\Release\sharp.node [cordova-res] [cordova-res] - Remove the “node_modules/sharp” directory, run “npm install” and look for errors [cordova-res] - Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/ [cordova-res] - Search for this error at https://github.com/lovell/sharp/issues [cordova-res] [ERROR] An error occurred while running subprocess cordova-res.
cordova-res.cmd ios exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
My ionic info
:
<paste here>
Other Information:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
This isn’t really a bug in Ionic CLI. You’ll have to fix the installation of sharp, which is the image processing dependency of
cordova-res
. I noticed you have the tool installed in your project, which isn’t our recommended strategy.Install it globally:
npm uninstall cordova-res
npm install -g cordova-res
Here are some more things you can try (keep in mind you will need the
-g
flag in npm for working with global installations):npm uninstall cordova-res
(making sure that thenode_modules/sharp
directory is removed) and thennpm install cordova-res
Also, you can pass the
--no-cordova-res
flag to use the old method (remote resource generation).sudo npm uninstall cordova-res && sudo npm install -g cordova-res --unsafe-perm=true