Install Node

In this tutorial, I will try to show you how to create an angular project by cli.

First of all, you need to install node. To do so go to nodejs.org.

And download latest one depends on your OS.

If it already installs on your machine. Please confirm that you are running at least node version 6.9.x and npm version 3.x.x or higher version.

To check your node and npm version. Type following command on terminal

If your node or npm version is lower than the requirement, Please update it.

Install Angular Cli

Then install angular cli globally on your machine by the following command.

It will take some time to complete depends on the internet speed.

If get any error please uninstall it by npm uninstall -g @angular/cli.

Then clean cache by npm cache clear. Then try again. It does not clear cache successfully please restart your machine and try again.

angular cli

After successfully completed angular cli installation. You will see a window like above.

Create Project

Now Open the terminal and go to the location where you want to create your project.

After that run below command to create a new project.

You can also add the cli command to use sass for CSS. Also can add routing which helps you to provide routing for your app.

For this, you need to run following instead upper one.

Please check angular cli command for more options.

Now go inside your project folder.

To run your project type

You will see a window like below. If successfully run your project.

Copy the url and paste into the browser and hit enter.

Your project setup is done.

Create New Component

To generate new component, go to terminal and type below code.

It will be automatically imported component to your module file.

You just need to setup routing for this. See my video tutorial for that.

Source Code: github.com
Youtube Playlist: MEAN Stack
Mean Stack Tutorial: Mean Stack(step by step)

Feel free to give your valuable feedback in comment section. Enough for today, see you soon.


Leave a Reply

Your email address will not be published. Required fields are marked *