In my situation, the issue was related to the version I was trying to install.
ngx-markdown version 19.0.0 requires Angular 19, whereas my project was using Angular 18.2.13. Therefore, the correct version of ngx-markdown for my project was 18.1.0.
For those facing a similar issue, you can check the compatible versions of ngx-markdown based on your Angular version at the following link.