I upgraded the Angular Project It was angular CLI 18.2.5 to angular CLI 18.2.11 and received this error.
I did a npm update and then a npm outdated to confirm the versions installed were correct, still no luck.
I ended up completely wiping the node_modules folder and reinstalling with npm install! Problem solved.