axe312ger / sqip

"SQIP" (pronounced \skwɪb\ like the non-magical folk of magical descent) is a SVG-based LQIP technique.
http://axe312ger.github.io/sqip
The Unlicense
3.37k stars 82 forks source link

Cannot install the thing: SyntaxError: Unexpected token '.' #347

Open jasomdotnet opened 3 months ago

jasomdotnet commented 3 months ago

On Ubuntu 22.04.4 LTS I cannot install the thing. The command npm install -g sqip-cli@canary returns text like this:

npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/sqip-cli/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! /usr/local/lib/node_modules/sqip-cli/node_modules/tar-fs/index.js:6
npm ERR! const win32 = (global.Bare?.platform || process.platform) === 'win32'
npm ERR!                            ^
npm ERR! 
npm ERR! SyntaxError: Unexpected token '.'
npm ERR!     at wrapSafe (internal/modules/cjs/loader.js:915:16)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:963:27)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR!     at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR!     at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR!     at require (internal/modules/cjs/helpers.js:74:18)
npm ERR!     at Object.<anonymous> (/usr/local/lib/node_modules/sqip-cli/node_modules/sharp/install/libvips.js:18:15)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-06-11T10_18_25_771Z-debug-0.log

Installed as root on 2 different machines with same result. If you need more info, let me know.

axe312ger commented 4 weeks ago

You probably are executing it with a very old version of node. Optional chaining is part of JS since 2020 😅

Can you please try it with node v18.12.1 or newer? :)

jasomdotnet commented 4 weeks ago

Can you please try it with node v18.12.1 or newer? :)

Hi, I would like to but since my post I have changed distro. I think you may close this issue.

Anyway, great job with the lib.