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 [email protected]
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
sharp
- apparently it tries to use CPU instructions that are not supported on your CPU. Try an older version ofsharp
. – Sledjimp
. – Cabansharp
version that works. Strategy: Try the oldest version you can find. If that works, find the "middle" between that and the latest version, try again. Keep doing that until you have the latest version that works on your CPU, it should only take 3 or 4 tries to pinpoint it. – Sledsharp
another chance :) – Caban