1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

ngx-color-picker installation getting an error

Discussão em 'Angular' iniciado por jkfe, Junho 30, 2025.

  1. jkfe

    jkfe Guest

    I'm trying to install ngx-color-picker in my Angular application following these instructions:

    https://www.npmjs.com/package/ngx-color-picker/v/16.0.0

    Installing it using the command below works successfully:

    npm install ngx-color-picker --save

    I can run ng serve and no error occurs.

    But when I import it like below:

    import { ColorPickerModule } from 'ngx-color-picker';

    @NgModule({
    ...
    imports: [
    ...
    ColorPickerModule
    ]
    })


    I get this error when executing ng serve:

    Error: node_modules/ngx-color-picker/lib/color-picker.directive.d.ts:108:103 - error TS2344: Type '{ colorPicker: { alias: "colorPicker"; required: false; }; cpWidth: { alias: "cpWidth"; required: false; }; cpHeight: { alias: "cpHeight"; required: false; }; cpToggle: { alias: "cpToggle"; required: false; }; ... 33 more ...; cpExtraTemplate: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
    Property '"colorPicker"' is incompatible with index signature.
    Type '{ alias: "colorPicker"; required: false; }' is not assignable to type 'string'.


    I'm using Angular 15.

    Continue reading...

Compartilhe esta Página