ng --version shows <error> for Angular version number and some packages

Viewed 4772

when trying to retrieve the information about my Angular package, i got the below <error> both for Angular version, one package and typescript :

$ ng --version

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


Angular CLI: 12.1.3
Node: 14.17.3
Package Manager: npm 6.14.13
OS: win32 x64

Angular: <error>
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1201.3 (cli-only)
@angular-devkit/build-angular   <error>
@angular-devkit/core            12.1.3 (cli-only)
@angular-devkit/schematics      12.1.3 (cli-only)
@angular/cli                    12.1.3 (cli-only)
@schematics/angular             12.1.3 (cli-only)
rxjs                            6.6.7 (cli-only)
typescript                      <error>

I've tried uninstall / install again both node.js, npm, angular/cli. Nothing works ! still the error keeps coming back. Any idea on your side ?

2 Answers

i solved this using the standard registry using npm config delete registry and after that i could install angular globally and then install the dependencies with npm i

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

Angular CLI: 12.2.17
Node: 16.10.0 (Unsupported)
Package Manager: npm 7.24.0
OS: darwin x64

Angular: 12.2.16
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.17
@angular-devkit/build-angular   12.2.17
@angular-devkit/core            12.2.17
@angular-devkit/schematics      12.2.17
@angular/cli                    12.2.17
@schematics/angular             12.2.17
rxjs                            6.6.7
typescript                      4.3.5

Delete your node_modiles and your package-lock.json:

rm -rf node_modules
rm package-lock.json

Then install all packages again:

npm install

And if that doesn't help try to reinstall the angular devkit:

npm install @angular-devkit/build-angular
Related