Kousika Ganesan
Kousika Ganesan

Reputation: 609

Error: Can't resolve '@angular/cdk/rxjs'

I added angular material in my project, Im getting this error. I removed my node modules and re-installed too. Even then Im getting this error.

Failed to compile.

./~/@angular/material/esm5/autocomplete.es5.js
Module not found: Error: Can't resolve '@angular/cdk/rxjs' in '/home/asus/angular-app/node_modules/@angular/material/esm5'
 @ ./~/@angular/material/esm5/autocomplete.es5.js 16:0-89
 @ ./~/@angular/material/esm5/material.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:5454 ./src/main.ts

Upvotes: 2

Views: 9752

Answers (2)

isgarci
isgarci

Reputation: 51

I experienced the same error. The version of "@angular/material" appearing in the dependencies defined in package.json, mismatched the one gotten by running the command:

npm show @angular/material version

It was solved by updating angular material to the latest version by running this command:

npm install @angular/material@latest --save

Check that the installed version matches the one defined in package.json.

Upvotes: 1

Edric
Edric

Reputation: 26801

Did you see the changelog (aka 5.0.0-rc0)? That's because they're removing rxjs from @angular/cdk. You should use rxjs instead.

From the changelog:

  • @angular/cdk/rxjs has been removed in favor of RxJS 5.5's lettable operators.

Upvotes: 5

Related Questions