angularnpmnode-modulespackage.jsonangular-flex-layout

Module not found: Error: Can't resolve '@angular/flex-layout' in '/app'


I suddenly got this error

Module not found: Error: Can't resolve '@angular/flex-layout' in '\src\app'

This error occurred After I have install @angular/cdk,

After this error I have again installed flex-layout using

 npm install @angular/flex-layout

But now there is error for

Module not found: Error: Can't resolve '@angular/http' in '\src\app'

If I Install a http, then some other module is getting missed. How to stop this situation? What has gone wrong?

If I install @angular/http then again it starts with

Module not found: Error: Can't resolve '@angular/flex-layout' in '\src\app'

Solution

  • Try adding full read-write access to node_modules folder

    chmod -R 777 /node_modules
    

    Then update the node_modules package

    npm install