Cannot find module '@angular/compiler'

前端 未结 7 988
南方客
南方客 2020-12-13 13:42

I run the command npm install -g @angular/cli and after i tried to run my app it says, Cannot find module \'@angular/compiler\' in the terminal. How can i install the compil

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 14:05

    Try to delete that "angular/cli": "1.0.0-beta.28.3", in the devDependencies it is useless , and add instead of it "@angular/compiler-cli": "^2.3.1", (since it is the current version, else add it by npm i --save-dev @angular/compiler-cli ), then in your root app folder run those commands:

    1. rm -r node_modules (or delete your node_modules folder manually)
    2. npm cache clean (npm > v5 add --force so: npm cache clean --force)
    3. npm install

提交回复
热议问题