When running ng serve my code fails to compile and gives me this error:
ERROR in node_modules/@angular/compiler-cli/src/transformers/program.d.ts(9,23): error TS2307: Cannot find module 'path'.
I thought that it had something to do with that my local angular version is an older version than my global version, so I tried this solution
But this didn't help. Now for my code to compile I have to delete a ';' somewhere random in my project, save the project, add the semicolon back and save the project. With this method, my code compiles and my app works but the error is still there.