2

I want to install Sharp module in my NodeJS project. I try to install it with npm install sharp command, but I am facing the below error:

npm ERR! code 1
npm ERR! path D:\project\node_modules\sharp
npm ERR! command failed
l) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-win32-x64.tar.br

I also tried to use all of the possible solutions in the "Can't install Sharp" related question, but no one is worked. I can't find any solution to solve this problem, and I decided to ask for help here.

I am using VScode v 1.63, NodeJS v16.13.2 and windows 10. Can anyone help me to solve this problem? Is there any way to install this module manually? and is it related to downloading "libvips-8.12.2-win32-x64.tar.br" file?

Edit: When I use npm i --verbose sharp comment, the installation gets stuck in the following section:

npm timing metavuln:load:security-advisory:parcel-bundler:OrlS5xtuVxJCDP7NSg7/QvMx6OKNoTjHkjeXkUKzhwF+vr5trxR0E3tR1S11cCq+ckauIRqtNNPJdYnysyx5qQ== Completed in 0ms
npm timing metavuln:calculate:security-advisory:parcel-bundler:OrlS5xtuVxJCDP7NSg7/QvMx6OKNoTjHkjeXkUKzhwF+vr5trxR0E3tR1S11cCq+ckauIRqtNNPJdYnysyx5qQ== Completed in 6ms
npm timing auditReport:init Completed in 1324ms
npm timing reify:audit Completed in 2448ms
[##################] - reify:sharp: timing reify:audit Completed in 2448ms
Balrug
  • 21
  • 1
  • 5
  • try "npm cache clean --force" – Guille Sanchez Feb 08 '22 at 09:19
  • @GuilleSanchez Thank you for your comment. I tried `npm cache clean --force` but it didn't work. I guess npm can not download files from sharp github repository. – Balrug Feb 08 '22 at 18:50
  • are you able to direct download the package? – Guille Sanchez Feb 08 '22 at 19:53
  • @GuilleSanchez Yes I can download it but I do not know how to install it manually. – Balrug Feb 09 '22 at 07:04
  • Had the same issue. I just used `yarn add sharp` and it was fixed. If this doesn't help, you may want to try [this link](https://stdworkflow.com/1614/npm-install-sharp-failed-due-to-libvips-download-failure) instead. (run `npm config get cache` to find your cache location. Put downloaded package in libvips folder, re execute `npm i sharp -S` ) – Gökhan Mete ERTÜRK Sep 01 '22 at 19:00

0 Answers0