When we upgrade the angular version 8 to 9 then it is show the following error during ng serve.

When we upgrade the angular version 8 to 9 then it is show the following error during ng serve.

Renderer had been deprecated for some time now, and finally removed in Angular 9. You should migrate to Renderer2.
npm i @angular/core@8 @angular/cli@8, assuming you were on version 8. Sometimes your package.json and package-lock.json will get out of sync and your project will use what's inside of the package-lock.json file. So now, run npm i to sync them up. If you still run into problems after that, run npm ci to do a completely clean install of your dependencies.