8

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?

Bytech
  • 1,125
  • 7
  • 22
Mr. Developer
  • 3,295
  • 7
  • 43
  • 110
  • As I understand, the error appeared after moment plugin installation. Did you try uninstall moment, then reinstall `@angular/cli` and then reinstall moment? – youri Jun 25 '19 at 09:11
  • yes i've tried to uninstall and re-install angular/cli but doesn't works.. – Mr. Developer Jun 25 '19 at 09:13
  • Just try to uninstall angular/cli globally and then install it with the version that your project is. Also check in case you installed momento globally. – Bozhinovski Jun 25 '19 at 09:25

2 Answers2

11

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.

Bytech
  • 1,125
  • 7
  • 22
5

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)

Gourav Pokharkar
  • 1,568
  • 1
  • 11
  • 33