I get this error:Cannot find module '@angular-devkit/build-angular/package.json when I try run my app with ng serve from Linux

前端 未结 10 2873
逝去的感伤
逝去的感伤 2021-02-19 13:30

hello guys I have this next error when I try run my App from the terminal(linux), when I run this command:

ng serve

and I get this

相关标签:
10条回答
  • 2021-02-19 13:51

    The error states that "Cannot find module '@angular-devkit/build-angular/package.json'" which means you have to have that package added.

    1. install the latest npm

      npm install -g npm@latest

    2. add the missing

      npm install --save-dev @angular-devkit/build-angular

    0 讨论(0)
  • 2021-02-19 13:53

    Under the project directory run the following command

    npm install --save-dev @angular-devkit/build-angular
    
    0 讨论(0)
  • In my case running npm install in project folder solved the problem.

    0 讨论(0)
  • 2021-02-19 13:57

    In my case these 2 commands helped:

    npm install -g npm@latest
    npm install -g @angular/cli
    
    0 讨论(0)
  • 2021-02-19 13:57

    Install @angular-devkit/build-angular as dev dependency. This package is newly introduced.

    npm i @angular-devkit/build-angular

    0 讨论(0)
  • 2021-02-19 14:02

    I have faced this issue when i recently upgraded the Angular CLI to Angular 9. the following commands fixed the issue.

    npm install --save-dev @angular-devkit/build-angular
    npm install
    ng serve -o
    
    0 讨论(0)
提交回复
热议问题