Pravin
Pravin

Reputation: 91

simplebar-angular is not working, Error: Cannot find module 'simplebar-angular' or its corresponding type declarations | Anguler

simplebar-angular is not working, Error: Cannot find module 'simplebar-angular' or its corresponding type declarations | Angular

install command I've tried as below

npm i simplebar-angular
yarn add simplebar-angular

it's added after installation in the package.json as below,

"dependencies": {
    "@angular/animations": "^14.2.0",
    "@angular/common": "^14.2.0",
    "@angular/compiler": "^14.2.0",
    "@angular/core": "^14.2.0",
    "@angular/forms": "^14.2.0",
    "@angular/platform-browser": "^14.2.0",
    "@angular/platform-browser-dynamic": "^14.2.0",
    "@angular/router": "^14.2.0",
    "rxjs": "~7.5.0",   
    "simplebar-angular": "^3.2.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  }

after adding the package I'm importing it to app.module.ts as below,

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SimplebarAngularModule } from 'simplebar-angular';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    SimplebarAngularModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

please check the below error images,

enter image description here

enter image description here

enter image description here

enter image description here

I've also tried all the steps after the clean catch as below,

npm cache clean --force

but still facing the same error, please help, thank you!

Upvotes: 0

Views: 839

Answers (1)

Goutham Harshith
Goutham Harshith

Reputation: 283

You should also install the dependencies for simplebar-angular. In your case you need to install simplebar-core Link is here . You can check this stackblitz Link is here. You can compare your dependencies with this live example. Hopefully this should work.

Upvotes: 1

Related Questions