Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular App won't run after Cloning from a Git Repository

Tags:

git

npm

angular

I recently completed the Angular Tour of Heroes tutorial (with some slight modifications) and it all works fantastically well. I then wanted to try push it up to a GIT repo in VSTS, and then clone it to another machine and run it from there. Unfortunately now I've cloned it to the new machine I'm unable to get it running. Both ng serve --open and ng build fail.

Originally it was complaining about missing "@angular-devkit/build-angular" so I went ahead and installed that, unfortunately on the next build attempt there was another issue

"Cannot find module '@angular-devkit/build-optimizer'"

Is it going to be the case that I need to reinstall every dependency every time I clone a solution using Angular or Node, or is there a simple command I'm missing here?

Google suggested I try "npm install -g npm-install-missing" and "npm rebuild", unfortunately neither helped.

like image 489
LozBlake15 Avatar asked Sep 02 '18 11:09

LozBlake15


2 Answers

After cloning the project just follow the instructions.

cd 'your project name...'

And then install the packages and dependencies.

npm install

and then you can run the project by running this code.

ng serve

This should work fine.

like image 176
Prashanth Damam Avatar answered Sep 29 '22 04:09

Prashanth Damam


You need to npm install before serving

like image 31
SaN ThosH Avatar answered Sep 29 '22 05:09

SaN ThosH