'ngcc' not recognized as internal or external command

12.9k views Asked by At

Running command npm run ngcc throws the error 'ngcc' is not recognized as an internal or external command.

package.json

{
  "scripts": {
    "ngcc": "ngcc"
    ...
  },
  "dependencies": {
    "@angular-extensions/elements": "^9.3.0",
    "@angular/animations": "~9.1.0",
    "@angular/common": "~9.1.0",
    "@angular/compiler": "~9.1.0",
    "@angular/core": "~9.1.0",
    "@angular/elements": "~9.1.0",
    "@angular/forms": "~9.1.0",
    "@angular/platform-browser": "~9.1.0",
    "@angular/platform-browser-dynamic": "~9.1.0",
    "@angular/router": "~9.1.0",
    ...
  }
}

Is there any mismatch in the version of anuglar-compiler and other packages? Not able to find the root cause of the issue. Can someone please help?

1

There are 1 answers

1
Diogo Poeira On

Have you tried running "npm ci"? It fixed the problem for me, it seems my cli was not correctly installed. https://preview-docs.npmjs.com/cli-commands/npm-ci