Setting up Angular2 in Linux System


by Samarth Sinha on 2017-06-17 00:41:38

Angular 2 is an open source JavaScript framework to build web applications in HTML and JavaScript.

To start working with Angular 2, you need to get the following key components installed.

  • Npm − This is known as the node package manager that is used to work with the open source repositories. Angular JS as a framework has dependencies on other components. And npm can be used to download these dependencies and attach them to your project.

  • Git − This is the source code software that can be used to get the sample application from the github angular site.

For Linux system run the following commands to setup angular2 project.

sudo apt-get update
sudo apt-get install git //git may be in your system by default.
git --version //to check git version
sudo apt-get install npm //npm may be in your system by default.
npm -v //to check npm version
sudo npm install nodejs
node -v //to check nodejs version

//If you have older version of npm and nodejs install new one by running the below commands
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs
//It will install the nodejs version 6.11 and also update npm to version 3.10

git clone myapp //It will craete a myapp folder which will have all the angular2 default files.

cd myapp
npm install //It will install all the nodejs dependencies in your project

Your Angular 2 application is now installed in your myapp folder. Now for running the application execute the following command:

npm start

Now open http://localhost:3000 on your browser and see your application.

Viewer Comments (1)

About the Author

  • avatar
    Samarth Sinha

    My name Samarth Sinha. I work on developing Web Applications using PHP and MySQL and in different frameworks of PHP like Laravel, CakePHP, CodeIgnitor and Smarty. In databases I have worked in MySQL and Postgres. I started this blog to share my knowledge to those who wants to start developing Web Applications using PHP.