Cant install colorthief

677 Views Asked by At

I ran into somewhat of a problem while trying to run npm i colorthief

I get many error messages, among them:

npm WARN deprecated [email protected]: this library is no longer supported

npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1 npm ERR! git dep preparation failed

Is this library no longer supported?

1

There are 1 best solutions below

0
Muspro Dev On

You should try to import it from a CDN rather than installing it as an NPM dependency:

import ColorThief from "https://cdnjs.cloudflare.com/ajax/libs/color-thief/2.3.0/color-thief.umd.js";