0

I tried to start the project as always but I find this problem blocking me. I tried with some solutions found on stack overflow but it didn't work. Any suggestion please?enter image description here

Giannis
  • 1,790
  • 1
  • 11
  • 29
Latome
  • 137
  • 2
  • 16

2 Answers2

0

You can try what the error message allready said. Remove the node_modules folder and the package-lock.json file. After that do npm install and try to start again.

Tr1monster
  • 328
  • 3
  • 13
  • commands to remove node_modules and package.json please – Latome Jan 07 '21 at 10:32
  • Navigatie to your project folder in your cmd and than use `rmdir /S node_modules` to remove the folder. With `del /f package-lock.json` you can delete the file. Otherwise just use the windows explorer. Should also work. – Tr1monster Jan 07 '21 at 10:48
  • so how I can install it after ? – Latome Jan 07 '21 at 10:50
  • run `npm install` in your cmd. This will pull all necessary dependencies for the project. These are stored in the `node_modules` folder. – Tr1monster Jan 07 '21 at 10:52
  • what I can do after that , I used ' ng serve ' and he didn"t recognize 'ng' command – Latome Jan 07 '21 at 10:58
  • Could you post your file structure? Make sure that you inside the project folder, when you try to run it. Otherwise try `npm start`. – Tr1monster Jan 07 '21 at 11:01
  • npm start worked for me , but why ng serve didn"t want to run my project , for weeks I always start my project with ng serve , and now he even don"t regnize ng command what happened ? – Latome Jan 07 '21 at 11:08
  • I can not awser this for sure. Take a look at this post [link](https://stackoverflow.com/questions/44692612/npm-run-start-working-whereas-ng-serve-not-working). The error could cause by a version confilct of the `@angular/cli` or something else. Import is that you can run your project. – Tr1monster Jan 07 '21 at 11:19
  • I checked the link but there is no answer for the issue – Latome Jan 07 '21 at 11:21
  • 1
    Here [link](https://stackoverflow.com/questions/46623571/angular-ng-command-not-found/46623602) are also some suggestions. I would try to run `npm install -g @angular/cli@` – Tr1monster Jan 07 '21 at 11:28
0

Did you ensure that you are in the same directory as package.json? If so, you can try the following update

ng update @angular/cli --migrate-only --from=<WhateverVersionYouAreCurrentlyOn>

for instance ng update @angular/cli --migrate-only --from=1.7.3

My answer is based on the answer to another topic. you can find it here

Avi Siboni
  • 686
  • 7
  • 16
  • 1
    yes ,I'm working on this project for weeks but I don"t know why he don"t want to start today. – Latome Jan 07 '21 at 10:49