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'

Upvotes: 12

Views: 25612

Answers (5)

Akhilesh Kumar
Akhilesh Kumar

Reputation: 21

if you are having problem as shown in image then it is require to run -

npm install @angular/flex-layout --force

this command forcefully install flex-layout to your machine.

Upvotes: 2

Sathiamoorthy
Sathiamoorthy

Reputation: 11660

Install the below package to avoid this issue.

npm install @angular/flex-layout

OR add the below code in package.json and do the npm install

"@angular/flex-layout":"12.0.0-beta.34"

Upvotes: 7

TopsCreative
TopsCreative

Reputation: 1

Try to keep the same version of angular cdk and angular/flex-layout. for me also having same issue due to layout version was higher than angular c

Upvotes: 0

Ekta arora
Ekta arora

Reputation: 65

For me, the issue was with the @angular/cdk version.@angular/flex-layout required version 12.0.0 for installation. Simply go to package.json and change the @angular/cdk version to 12.0.0. Then run npm install -s @angular/flex-layout

Upvotes: 1

akhil Rao
akhil Rao

Reputation: 1169

Try adding full read-write access to node_modules folder

chmod -R 777 /node_modules

Then update the node_modules package

npm install

Upvotes: 8

Related Questions