Buidling the application after having upgraded dependcies to Angular 9 (and having performed necessary code changes) throws an error:
Compiling @ang
Try to remove the node_modules folder and run install again:
node_modules
rm -rf node_modules
npm install
For me it has solved the problem.