antonreshetov / image-optimizer

A tool for optimizing images and vector graphics.
MIT License
888 stars 63 forks source link

Project does not build #14

Closed focussing closed 2 years ago

focussing commented 2 years ago

I cloned the latest sources, ran npm install and then npm run dev or npm run build fail.

src/main/image-compressor.ts:197:21 - error TS2339: Property 'data' does not exist on type 'OptimizedError | OptimizedSvg'.

197             const { data } = svg.optimize(buffer)
                        ~~~~

Found 1 error.
focussing commented 2 years ago

Next I used yarn and now it comes up with another error message. Not very useful though. Might be that it means that my node installation is too old?

yarn install v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error electron-builder@22.14.5: The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "12.22.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
iMac:image-optimizer raymond$ yarn dev
yarn run v1.22.10
$ tsc-watch -p tsconfig.electron.json --onSuccess 'npm run dev:server'
/bin/sh: tsc-watch: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
focussing commented 2 years ago

Updated yarn to 1.22.17 No useful message occurs anymore


iMac:image-optimizer raymond$ yarn dev
yarn run v1.22.17
$ tsc-watch -p tsconfig.electron.json --onSuccess 'npm run dev:server'
/bin/sh: tsc-watch: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```
focussing commented 2 years ago

Installed the latest nodejs version 14.19.0 and bingo!

antonreshetov commented 2 years ago

The first line of the error says:

error electron-builder@22.14.5: The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "12.22.1"