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 2826
逝去的感伤
逝去的感伤 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.

提交回复
热议问题