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?
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.
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 .
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With