tacoss / testcafe-blink-diff

Visual regression for Testcafé
65 stars 15 forks source link

Package does not install on Node.js 18 #41

Closed VitalyEmelyanov closed 2 years ago

VitalyEmelyanov commented 2 years ago

The latest version of the testcafe-blink-diff (0.4.12) has added the following dependencies:

"native-image-diff": "^0.1.14",
"node-libpng": "^0.2.20",

This fails to install on Node v18:

npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/testcafe-blink-diff/node_modules/native-image-diff
npm ERR! command failed
npm ERR! command sh -c -- node scripts/install.js
npm ERR! Downloading native-image-diff prebuilt binary from "https://github.com/Prior99/native-image-diff/releases/download/0.1.14/native-image-diff-linux-x64-108.node".
npm ERR! /usr/local/lib/node_modules/testcafe-blink-diff/node_modules/native-image-diff/scripts/install.js:38
npm ERR!             throw new Error(`No supported native-image-diff ${packageVersion} build found for node ${process.version} on ${process.platform} (${process.arch}).`);
npm ERR!             ^
npm ERR!
npm ERR! Error: No supported native-image-diff 0.1.14 build found for node v18.8.0 on linux (x64).
npm ERR!     at Request.<anonymous> (/usr/local/lib/node_modules/testcafe-blink-diff/node_modules/native-image-diff/scripts/install.js:38:19)
npm ERR!     at Request.emit (node:events:513:28)
npm ERR!     at Request.onRequestResponse (/usr/local/lib/node_modules/testcafe-blink-diff/node_modules/request/request.js:1059:10)
npm ERR!     at ClientRequest.emit (node:events:513:28)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:693:27)
npm ERR!     at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
npm ERR!     at TLSSocket.socketOnData (node:_http_client:534:22)
npm ERR!     at TLSSocket.emit (node:events:513:28)
npm ERR!     at addChunk (node:internal/streams/readable:324:12)
npm ERR!     at readableAddChunk (node:internal/streams/readable:297:9)
npm ERR!
npm ERR! Node.js v18.8.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-08-29T05_30_24_728Z-debug-0.log
pateketrueke commented 2 years ago

Yeah, sadly it only supports up to v16 of node but I did not found faster alternatives... what's your recommendation on this cases? You would like to fork native-image-diff and build for v16+ so we can use your fork instead? Thank you!

VitalyEmelyanov commented 2 years ago

Why were these libraries added? What has changed compared to the previous versions that we now need them?

pateketrueke commented 2 years ago

The usage of blink-diff is not stable and it's archived 6 years ago, nothing else changed. I just researched a bit for alternatives, also pixelmatch can be used... but I did not tested it yet.

VitalyEmelyanov commented 2 years ago

native-image-diff looks also a bit outdated...

pateketrueke commented 2 years ago

Well, that'ts true too... then just wait until I replace it again, sorry.

pateketrueke commented 2 years ago

Or send a PR with your corrections, thank you.

pateketrueke commented 2 years ago

Update: pixelmatch works fine too... but it does not provides a way to fill areas on images, which is required for the blockout feature. 💭

pateketrueke commented 2 years ago

Update: pngjs works fine, but I did not grasp how to fill the blockOut areas... any help?

pateketrueke commented 2 years ago

Update: finally got it! 💣