Through my conversation with @Tomalak, it seems that the latest version of sharp
is not compatible with my CPU:
Theres nothing wrong with your code. That's a bug in sharp - apparently it tries to use CPU instructions that are not supported on your CPU. Try an older version of sharp. – Tomalak
I tried a couple of older versions. The latest version that works for me is 0.27.2
. you can install it using this command:
npm i sharp@0.27.2
I also opened an issue on their GitHub page:
https://github.com/lovell/sharp/issues/2723#issue-894046354
My environment (npx envinfo --binaries --system
):
System:
OS: Linux 5.4 Linux Mint 20 (Ulyana)
CPU: (2) x64 Pentium(R) Dual-Core CPU E5300 @ 2.60GHz
Memory: 172.51 MB / 3.84 GB
Container: Yes
Shell: 3.2.2 - /usr/bin/fish
Binaries:
Node: 10.19.0 - /usr/bin/node
npm: 7.6.1 - /usr/local/bin/npm