我在尝试执行 ng serve 时收到此错误“发生未处理的异常:找不到模块‘@angular/compiler-cli’

I Get this error when im trying to execute ng serve "An unhandled exception occurred: Cannot find module '@angular/compiler-cli'

我从 Angular/cli 开始,当我尝试执行 ng serve 时出现此错误。我已经更新了 npm 并且我做了 cache clean --force,我已经重新启动了我的电脑和所有这些但仍然无法工作, 我已经尝试在目录本身中执行全局操作,似乎一切正常,有什么帮助吗?

要强调的是,在那个错误之后我得到了“找不到模块'@angular-devkit/build-angular/package。json'”我已经更新了 npm,重新安装了 nodejs 并在我通过时安装了 npm但现在我明白了。 我在 windows.

工作

enter image description here

尝试在你的项目中安装编译器npm i @angular/compiler-cli --save 然后 ng serve