I am using some open source code that is a couple of years old to create a blog. The Source code was created using with Angular v 11 and an earlier version of Toastr to create error messages. I have Angular v 13 on my machine but haven't had any problems making the API for the project. Now I am getting this error when I try to build the front end after adding an error interceptor:
./node_modules/ngx-toastr/fesm2015/ngx-toastr.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js): TypeError: Cannot create property 'message' on string 'C:\Users\benja\CroweQuest\CroweQuest-UI\node_modules\ngx-toastr\fesm2015\ngx-toastr.mjs: This application depends upon a library published using Angular version 14.0.2, which requires Angular version 14.0.0 or newer to work correctly. Consider upgrading your application to use a more recent version of Angular.
If I upgrade to v 14 of Angular it gives me many other problems with the source code that I would not rather try to dig into to fix. I have tried going backward in Angular to v 11 but that didn't work. I also have tried to run npm --legacy-peer-deps
, but that doesn't work either.
Is there a way to go back to an earlier version of Toastr?
Here are some full screenshots of the error: Screen shot of error
Second part of error screenshot.
Is there a way to go to an earlier version of Toastr, or how do you uninstall Toastr from your project? I have tried running npm uninstall toastr and it didn't work.
Thank you for any help you can give.
Find package.json
and revert to "ngx-toastr": "^14.3.0"
which is compatible with Angular 13. See here: https://stackblitz.com/edit/angular13-toastr-c55qqy?file=package.json
Delete node_modules
before hand.
npm install ngx-toastr ^14.3.0 --save