components icon indicating copy to clipboard operation
components copied to clipboard

unmet dependency angular/cdk

Open axtho opened this issue 9 years ago • 30 comments

Bug, feature request, or proposal:

BUG

What is the expected behavior?

ng serve should work

What is the current behavior?

compilation breaks:

ERROR in /Applications/MAMP/htdocs/memberhive2/web/node_modules/@angular/material/typings/core/core.d.ts (1,61): Cannot find module '@angular/cdk'.

ERROR in ./~/@angular/material/@angular/material.es5.js
Module not found: Error: Can't resolve '@angular/cdk' in '/Applications/MAMP/htdocs/memberhive2/web/node_modules/@angular/material/@angular'
 @ ./~/@angular/material/@angular/material.es5.js 19:0-75
 @ ./src/app/app-material.module.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
webpack: Failed to compile.

During yarn upgrade you get the following warning: warning "@angular/[email protected]" has unmet peer dependency "@angular/[email protected]".

@DevVersion it may have something to do with 17cc4a198f336e8ebefbb2710d8e80df2595db7e?

What are the steps to reproduce?

Just open the Plunker example ... the console tells the story: https://goo.gl/DlHd6U

What is the use-case or motivation for changing an existing behavior?

continue with upgrades

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

TS 2.4.0 @angular/cli: 1.1.3 node: 8.0.0 os: darwin x64 @angular/animations: 4.2.4 @angular/common: 4.2.4 @angular/compiler: 4.2.4 @angular/core: 4.2.4 @angular/flex-layout: 2.0.0-rc.1 @angular/forms: 4.2.4 @angular/http: 4.2.4 @angular/material: 2.0.0-beta.7-51bf26e @angular/platform-browser: 4.2.4 @angular/platform-browser-dynamic: 4.2.4 @angular/router: 4.2.4 @angular/cli: 1.1.3 @angular/compiler-cli: 4.2.4 @angular/platform-server: 4.2.4

Is there anything else we should know?

I am pulling from the master branch, updating almost daily. Yesterday morning the update did not break the build.

axtho avatar Jun 23 '17 07:06 axtho

Good point. Maybe it would make sense to refer for material2 builds to the cdk builds on GitHub.

I will start looking into this today

devversion avatar Jun 23 '17 07:06 devversion

I get the same error. for what its worth: i get the following errors after an npm install which includes @angular/[email protected]

npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.

up to date in 3.194s
PS C:\dev\material2-start> npm install @angular/[email protected]
npm ERR! code E404
npm ERR! 404 Not Found: @angular/[email protected]

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Tom Devolder\AppData\Roaming\npm-cache\_logs\2017-06-23T07_26_44_976Z-debug.log

TomDevolder avatar Jun 23 '17 07:06 TomDevolder

Is there any temporary solution?

arkhamvm avatar Jun 23 '17 07:06 arkhamvm

@arkhamvm for now just revert back to "@angular/material": "2.0.0-beta.7". I am sure it will be fixed by tomorrow.

axtho avatar Jun 23 '17 07:06 axtho

@axtho thanks.

arkhamvm avatar Jun 23 '17 08:06 arkhamvm

not fixed for today :( 2.0.0-beta.8

Max-0n avatar Jul 07 '17 08:07 Max-0n

same issue for me. I went back to 2.0.0-beta.7 to be able to go on with my code

mustafaekim avatar Jul 07 '17 08:07 mustafaekim

Do you have installed @angular/cdk?

chrste90 avatar Jul 07 '17 10:07 chrste90

npm install --save @angular/material @angular/cdk from documentation helped me too

w3chtml avatar Jul 07 '17 11:07 w3chtml

And just... do not forget to import CdkTableModule (if you are using MdTableModule).

PeS82 avatar Jul 07 '17 13:07 PeS82

npm install --save @angular/cdk resolved it.

senthiljruby avatar Jul 07 '17 14:07 senthiljruby

I would call this a breaking change.

jdell64 avatar Jul 07 '17 15:07 jdell64

@jdell64 so would I image

jelbourn avatar Jul 07 '17 16:07 jelbourn

Nice! I assumed you all followed the same versioning as angular, so when breaking changes happen, you'd bump the Major version number. I guess its tough to do so when the milestones for 2 aren't there yet, so that was my confusion. (certainly not complaining! love MD)

jdell64 avatar Jul 07 '17 17:07 jdell64

Yeah, during beta every release may still have breaking changes. Once beta is over the library will follow the same semver conventions as Angular.

jelbourn avatar Jul 07 '17 17:07 jelbourn

latest version Material : bug (Error)

ERROR in ./~/@angular/material/@angular/material.es5.js Module build failed: Error: ENOENT: no such file or directory, open 'C:\blog\blog-src\node_modules@angular\material@angular\material.es5.js' at Error (native) @ ./src/app/app.module.ts 19:0-96 @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

ERROR in ./~/@angular/animations/@angular/animations/browser.es5.js Module build failed: Error: ENOENT: no such file or directory, open 'C:\blog\blog-src\node_modules@angular\animations@angular\animations\browser.es5.js' at Error (native) @ ./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js 10:0-206 @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts


Fix : Downgrade to one lower version of material :

eliyow avatar Jul 12 '17 19:07 eliyow

In case you had a previous version of material or cdk, remove them first (npm remove) before reinstalling them.

Parziphal avatar Aug 17 '17 04:08 Parziphal

npm install --save @angular/[email protected] resolved it.

dvj1988 avatar Sep 15 '17 07:09 dvj1988

go with: npm install --save @angular/material@latest `-- @angular/[email protected]

npm install --save @angular/cdk@latest `-- @angular/[email protected]

ilnreddy avatar Sep 19 '17 17:09 ilnreddy

Back to "@angular/cdk": "2.0.0-beta.11", and @angular/material": "2.0.0-beta.11"

AndreyPatseiko avatar Oct 06 '17 12:10 AndreyPatseiko