TL;DR: rm -rf .angular
I had this suddenly on an old and working project, also for older commits. Nothing worked for me:
- removed node_modules and ran
npm i - run again
ng s - restart my computer
I had some odd clues (worked on different port, worked when I removed my folder and recloned the repo) that led my working solution: remove .angular folder (containing cache folder)