marcialwushu / TicTacToeGameAngular

:book: Create Simple Tic-Tac-Toe Game using Angular2 and Materials with ng-cli
0 stars 0 forks source link

Cannot find module... Problems with cdk #1

Open marcialwushu opened 5 years ago

marcialwushu commented 5 years ago
ERROR in ../node_modules/@angular/material/core/typings/datetime/native-date-adapter.d.ts:8:26 - error TS2307: Cannot find module '@angular/cdk/platform'.

8 import { Platform } from '@angular/cdk/platform';
                           ~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@angular/material/core/typings/option/option.d.ts:9:60 - error TS2307: Cannot find module '@angular/cdk/a11y'.

9 import { FocusOptions, FocusableOption, FocusOrigin } from '@angular/cdk/a11y';
                                                             ~~~~~~~~~~~~~~~~~~~
../node_modules/@angular/material/core/typings/ripple/ripple-renderer.d.ts:9:26 - error TS2307: Cannot find module '@angular/cdk/platform'.

9 import { Platform } from '@angular/cdk/platform';
                           ~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@angular/material/core/typings/ripple/ripple.d.ts:8:26 - error TS2307: Cannot find module '@angular/cdk/platform'.

8 import { Platform } from '@angular/cdk/platform';
                           ~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@angular/material/slider/typings/slider.d.ts:8:30 - error TS2307: Cannot find module '@angular/cdk/a11y'.

8 import { FocusMonitor } from '@angular/cdk/a11y';
                               ~~~~~~~~~~~~~~~~~~~
../node_modules/@angular/material/slider/typings/slider.d.ts:9:32 - error TS2307: Cannot find module '@angular/cdk/bidi'.

9 import { Directionality } from '@angular/cdk/bidi';
marcialwushu commented 5 years ago

ng version

C:\Users\carlosjunior\Documents\Workspace\angular\tic-tac-toe>ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 8.3.12
Node: 10.13.0
OS: win32 x64
Angular: 8.2.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.12
@angular-devkit/build-angular     0.803.12
@angular-devkit/build-optimizer   0.803.12
@angular-devkit/build-webpack     0.803.12
@angular-devkit/core              8.3.12
@angular-devkit/schematics        8.3.12
@angular/cdk                      8.2.3
@angular/cli                      8.3.12
@angular/material                 8.2.3
@ngtools/webpack                  8.3.12
@schematics/angular               8.3.12
@schematics/update                0.803.12
rxjs                              6.5.3
typescript                        3.5.3
webpack                           4.39.2
marcialwushu commented 5 years ago

The errors you are seeing would point to @angular/cdk not being installed as mentioned. Since you do have it installed, I would think that this is likely caused by stale packages.

I would suggest to try removing your node_modules/ directory and running npm install.

marcialwushu commented 5 years ago

Further, if you are using git and committing when the project is in a working state, you can edit files with confidence that you'll be able to later revert your changes. The following commands would likely fix this:

npm install --save @angular/material @angular/cdk
rm -rf node_modules
npm install