lokesh / color-thief

Grab the color palette from an image using just Javascript. Works in the browser and in Node.
https://lokeshdhakar.com/projects/color-thief/
MIT License
12.61k stars 1.31k forks source link

canvas version is deprecated - Update package.json #259

Closed manav-gopal closed 3 weeks ago

manav-gopal commented 1 month ago
yarn add color-thief           
yarn add v1.22.22
[1/4] Resolving packages...
warning color-thief > canvas > node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
warning color-thief > canvas > node-pre-gyp > npmlog@4.1.2: This package is no longer supported.
warning color-thief > canvas > node-pre-gyp > rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning color-thief > canvas > node-pre-gyp > npmlog > gauge@2.7.4: This package is no longer supported.
warning color-thief > canvas > node-pre-gyp > nopt > osenv@0.1.5: This package is no longer supported.
warning color-thief > canvas > node-pre-gyp > npmlog > are-we-there-yet@1.1.7: This package is no longer supported.
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @testing-library/user-event@14.5.2" has unmet peer dependency "@testing-library/dom@>=7.21.4".
[4/4] Building fresh packages...
[1/3] ⠁ canvas
[-/3] ⠁ waiting...
error  .\node_modules\color-thief\node_modules\canvas: Command failed.
Exit code: 7
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory:  .\node_modules\color-thief\node_modules\canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@20.17.0 | win32 | x64
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp http GET https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.5.0/canvas-v2.5.0-node-v115-win32-unknown-x64.tar.gz
node-pre-gyp http 404 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.5.0/canvas-v2.5.0-node-v115-win32-unknown-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.5.0/canvas-v2.5.0-node-v115-win32-unknown-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.5.0 and node@20.17.0 (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.5.0/canvas-v2.5.0-node-v115-win32-unknown-x64.tar.gz
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack Error: spawn EINVAL
node-pre-gyp ERR! stack     at ChildProcess.spawn (node:internal/child_process:421:11)
node-pre-gyp ERR! stack     at Object.spawn (node:child_process:762:9)
node-pre-gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
node-pre-gyp ERR! System Windows_NT 10.0.26120
node-pre-gyp ERR! node -v v20.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
lokesh commented 3 weeks ago

Curious what version of Color Thief you were attempting to install? I don't see the `node-pre-gyp' dep in the recent releases: https://github.com/lokesh/color-thief/blob/master/package-lock.json

Can you try upgrading and let me know if you still have the issue. I will we reopen if provided details on how to recreate.