How to run Angular code from Github in Vscode

Viewed 20937

Can anyone please help me on running someone's code that I downloaded from Github in Visual Studio code

5 Answers

You can directly run angular's github project without download it on Stackblitz

just replace github url with stackblitz url :

replace https://github.com/ with https://stackblitz.com/github/

Example :-

GitHub url : https://github.com/onecompileman/angular-stateside
replace with :  https://stackblitz.com/github/onecompileman/angular-stateside

Or Run github downloaded angular project from your computer.

Note : You must have nodeJS and angular-cli installed into your computer.

GO into your downloaded folder.

and Open command prompt. and write command : npm install after complete it. write ng serve --open.

and your project automatically open in your browser.

Try it

  1. Open VS code with corresponding downloaded folder
  2. In VS code open Integrated command prompt/terminal
  3. run npm install command
  4. run ng serve command
  1. Download the angular project
  2. Unzip the project. Suppose, your angular project name is my-app.
  3. After Unzip, open the project folder.
  4. Press Shift + Mouse Right click on background
  5. You will see Open Powershel/Open Window Here on the popup Menu
  6. Write the command: npm install or npm i
  7. After installing npm, write the command: ng serve or ng serve -open or ng serve -o
  8. Done!

Clone the repository from Github - Blank preferred

Open Visual code

Run commands

ng new notepad

npm install -g @angular/cli in the Visual Code

cd notepad

ng serve --open

Adding a remote repository

git remote add origin https://github.com/OWNER/notepad.git

git remote -v

View existing remotes

origin https://github.com/OWNER/REPOSITORY.git (fetch)

origin https://github.com/OWNER/REPOSITORY.git (push)

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.

If it shows an error as

Could not find module "@angular-devkit/build-angular"

Apply command

npm install --save-dev @angular-devkit/build-angular

to fix it.

Related