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 2875
逝去的感伤
逝去的感伤 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 14:07

    Had this exact issue on an existing Angular 10 project. The following steps resolved the issue for me:

    1. Delete the package-lock.json file.
    2. Delete the node_modules folder and all of its contents.
    3. Run npm install. Note that in my case I had to add the --force flag. YMMV

    At this point, ng build --prod completed successfully for me.

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

    npm install run this in your terminal and done.

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

    Please try installing the npm on a project folder. I had installed npm globally but installing the npm once again on a solution folder fixed my issue.

    npm install in the project folder will do the trick. Then do ng serve -o

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

    In my case 2 commands helped:

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

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

    0 讨论(0)
提交回复
热议问题