Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot determine versions of "@angular/cli" local installation is broken

So, I've broken my local installation after install moment plugin. This Momento plugin

After this installation, when I put command ng serve to running project, the return by the console is:

Cannot determine versions of "@angular/cli". This likely means your local installation is broken. Please reinstall your packages.

I've followed this: Could not find module "@angular-devkit/build-angular" but nothing.

So, I've tried to reinstall angular, but nothing, I've tried to run npm update but nothing... I don't know how to fix this, and I need to work.

Also, tried to re-checkout by git, but nothing.

The project was born in Angular 7 with Material. How can fix this?

like image 258
Mr. Developer Avatar asked Jun 25 '19 09:06

Mr. Developer


People also ask

How do you verify angular CLI is installed?

Use the command ng --version (or ng -v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to find out the globally installed version of Angular.

What is the latest angular CLI version?

The Angular latest Official stable version is Angular v13. 2.5, which is released on 2nd March 2022.

How do I know what version of angular I have?

Checking the Angular VersionOpen the Terminal + view in your project and type ng --version . For recent versions of Angular, this will list the versions of several Angular packages that you have installed in your project.


2 Answers

Restore your old package.json / package-lock.json, then delete all your contents of node_modules. After, from your project root run the following to rebuild the contents of node_modules:

npm install.

If you don't have a copy of the package files from before the problems started, first, uninstall moment - local and global - to prevent it from installing itself when you run npm install.

npm uninstall moment ngx-moment

npm uninstall -g moment ngx-moment

Then go with the step of deleting all your node_modules contents before running npm install in your project root.

like image 138
Bytech Avatar answered Sep 18 '22 09:09

Bytech


Please, check your version of @angular/cli (both, local and global) as Angular 8 is released. Also, try to match your version with current ngx-moment's @angular/cli version (i.e. "@angular/cli": "~7.0.3" as of June 2019)

like image 30
Gourav Pokharkar Avatar answered Sep 21 '22 09:09

Gourav Pokharkar