1

I am trying to use the ngx-toastr. I installed ngx-toastr, imported to the app.module.ts, and added to style in angular.json. I got a complie error after that. The following is the error:

ERROR in multi ./src/styles.css ../node_modules/ngx-toastr/toastr.css Module not found: Error: Can't resolve 'C:\Users\hjishe07\Desktop\firebase\node_modules\ngx-toastr\toastr.css' in 'C:\Users\hjishe07\Desktop\firebase\angularfirebasecrud' i 「wdm」: Failed to compile.

Axar
  • 521
  • 1
  • 3
  • 11
Jisheng Huang
  • 13
  • 1
  • 3

2 Answers2

1

There's probably a problem with css. As mentioned in the setup guide you should try with importing the css file to your angular.json file

"styles": [
  "styles.scss",
  "node_modules/ngx-toastr/toastr.css" // try adding '../' if you're using angular cli before 6
]
Nery Ortez
  • 460
  • 2
  • 9
0

Install the toastr using following commands :

  1. npm install ngx-toastr --save

  2. npm install @angular/animations --save

@angular/animations package is a required dependency for the default toastr.

Learn more about toastr here

pensum
  • 980
  • 1
  • 11
  • 25