I got this error upgrading from Angular 11 to Angular 13. This is the fix, run this in your terminal

rm package-lock.json
rm node_modules
rm dist 

npm cache clean --force
npm install



Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!