6

I am trying to run angular project with npm run start command but getting this error:

Cannot find module @angular/compiler-cli/src/tooling`.

Below is the result of ng --version:

Angular CLI: 7.0.7
Node: 12.14.1
OS: win32 x64
Angular: 7.0.4

package.json

@angular-devkit/architect         0.10.7
@angular-devkit/build-angular     0.1000.4
@angular-devkit/build-optimizer   0.1000.4
@angular-devkit/build-webpack     0.1000.4
@angular-devkit/core              7.0.7
@angular-devkit/schematics        7.0.7
@angular/cdk                      7.3.2
@angular/cli                      7.0.7
@angular/compiler-cli             7.2.16
@angular/material                 7.3.2
@ngtools/webpack                  10.0.4
@schematics/angular               7.0.7
@schematics/update                0.10.7
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.43.0
3
  • 1
    Have you run the npm install before npm run start? Commented Jul 31, 2020 at 14:37
  • @NaveenMotwani-AIS I ran npm ci as i need to ensure that packges are downloaded from packge-lock.json Commented Jul 31, 2020 at 15:01
  • Okay, you are also missing some packages, checkout my answer Commented Jul 31, 2020 at 15:02

5 Answers 5

1

@ngtools/webpack should be of a compatible with other packages version.

"@ngtools/webpack": "7.3.9"

should help

Sign up to request clarification or add additional context in comments.

Comments

1

I think you are missing some package from angular eg @angular/core please compare your package.json file and add accordingly.

enter image description here

One more tip, remove package.lock.json file and then run npm install.

1 Comment

where should i compare these? what file should i open and compare? is packge-lock.json?
0
  1. Delete node_modules
  2. update @angular/compiler-cli": "^10.2.0 in package.json
  3. make sure u have the correct node @types/node": "^14.14.2 in package.json
  4. finally npm install

This resolved the error for me

Comments

0

I was able to solve it by clearing the cache using npm cach clean --force and reinstalling the dependencies using npm init

Comments

0

Update angular/cli to the latest version

1- npm uninstall -g angular/cli
2- npm install -g @angular/cli@latest

Update the project dependencies

1- rm -rf node_modules (or delete your node_modules folder manually)
2- npm cache clean (npm > v5 add --force so: npm cache clean --force)
3- npm install --save-dev @angular/cli@latest
4- npm install

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.