Mohammed Ajmal
Mohammed Ajmal

Reputation: 590

How to run Angular code from Github in Vscode

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

Upvotes: 5

Views: 33968

Answers (5)

Shashikant Devani
Shashikant Devani

Reputation: 2454

You can directly run Angular GitHub projects without downloading on Stackblitz. Just replace the GitHub URL with the Stackblitz URL. Replace https://github.com/ with https://stackblitz.com/github/.

Example:

Or run an Angular project downloaded from GitHub on your computer.

Note: You must have NodeJS and angular-cli installed on your computer.

Go into your downloaded folder, open a command prompt and run npm install. After it completes, run ng serve --open and your project will automatically open in your browser.

Upvotes: 9

Surya R Praveen
Surya R Praveen

Reputation: 3745

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.

Upvotes: 1

Fono
Fono

Reputation: 1

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.

Upvotes: -1

Mohammad Zubair
Mohammad Zubair

Reputation: 109

  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!

Upvotes: 1

user10319547
user10319547

Reputation:

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

Upvotes: 8

Related Questions