question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find @angular/cdk when running 'ng serve'

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Being able to start an app with Angular Material

What is the current behavior?

After an ng serve I get a huge wall of text of errors.

What are the steps to reproduce?

I cannot show you the source code as it’s proprietary. The code was written with an old version of Angular and Angular Material. Hopefully showing the package.json and the error will be enough.

The full process has been:

  1. Cloning the project. Runnin npm install. Getting errors for deprecated packages and dependencies.
  2. Applying a more recent package.json for angular/cli and running again npm install. Everything install.
  3. Updating angular-cli.json to the new environments format. Run ng serve -o. Get the error shown in the following gist.

https://gist.github.com/theCrius/bbee299f3e5aeec9e911279b7fb684b3

Both the package.json are also present in this gist. The original project was writte in June 2016 so I suppose the issue is related to changes in @angular/material2 as the issue comes from not finding @angular/cdk missing package.

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

Not applicable.

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

I can’t make to the browser. The error is being showed in the console.

Is there anything else we should know?

Don’t know if it can be useful, the current ng --version result is as follows:

Angular CLI: 1.6.6
Node: 8.9.4
OS: win32 x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.6
@angular/material: 5.2.5
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.6
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
donroycocommented, Apr 25, 2018

Did you install CDK as well?

npm install --save @angular/material @angular/cdk

See the getting started guide.

1reaction
donroycocommented, Apr 25, 2018

@theCrius Did you include a theme as well (see step 4)?

@import "~@angular/material/prebuilt-themes/indigo-pink.css";
Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Can't resolve '@angular/cdk/scrolling'
To solve the error "Module not found: Can't resolve '@angular/cdk/scrolling'", make sure to install the package by opening your terminal in your project's...
Read more >
I just installed Angular Material and Angular Animations in my ...
Get into the Workspace or Angular project you are working with, open command prompt and run the below command:.
Read more >
@angular/cdk - npm
Start using @angular/cdk in your project by running `npm i @angular/cdk`. There are 2932 other projects in the npm registry using @angular/cdk.
Read more >
Getting started | Angular Material
Using the Angular CLI ng add command will update your Angular project with the correct dependencies, perform configuration changes and execute ...
Read more >
Fixing Could not find module @angular-devkit/build-angular ...
To fix Could not find module angular-devkit-build-angular error in Angular follow the below steps 1. Delete node_modules folder and run npm ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found