Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'ngcc' not recognized as internal or external command

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?

like image 760
user12023283 Avatar asked Feb 02 '21 09:02

user12023283


People also ask

How do you fix Ng is not recognized as an internal or external command?

To solve the error "ng is not recognized as an internal or external command, operable program or batch file", install the angular cli globally by running npm install -g @angular/cli@latest and make sure your PATH environment variable is set up correctly.

What does npm Ngcc do?

ngcc (which stands for Angular compatibility compiler) is designed to process code coming from NPM and produce the equivalent Ivy version, as if the code was compiled with ngtsc .

What is Ngcc?

Definition: NGCC is an advanced power generation technology which allows to improve the fuel efficiency of natural gas. Most new gas power plants in North America and Europe are of this type.

Why is NG command not working?

The error “ng command not found” occurs when your system's shell cannot find the path to the ng cli binary. There are three major causes of this error: The ng CLI is not installed. The ng CLI is located in a different directory.


1 Answers

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

like image 123
Diogo Poeira Avatar answered Oct 16 '22 10:10

Diogo Poeira