Error with the sharp package when instaling npm packages, node modules directory being removed

653 Views Asked by At

I have a new pc, installed Ubuntu 22.04 on it, and have just installed node 18.18.

Now I am trying to install packages of a project that includes Sharp and I am getting this error:

npm ERR! code 7
npm ERR! path /home/enoch/workspace/modernminds-ic/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

npm ERR! A complete log of this run can be found in: /home/enoch/.npm/_logs/2023-10-22T07_41_53_966Z-debug-0.log
1

There are 1 best solutions below

0
On

Sharp runs postinstall scripts that expect certain tools to be installed. Most likely you are missing some of the dependencies, such as python for node-gyp.