Wednesday, August 24, 2016

How to create angular project using YEOMAN

Create angular project using YEOMAN :

1)
Create a project folder and go inside. ($ mkdir FST, $cd FST)
Please install node.js and npm package manager globally using option "-g” as it can be used in other places for different projects.

- node.js can be installed from https://nodejs.org/en/. npm is installed as a part of the node. 
- To get latest npm, run the following command “sudo npm install npm -g” 


2)
Install yo and webapp generator (http://yeoman.io/)

- npm install -g yo
- npm install -g generator-webapp


3)
Install bower, a package manager. (https://bower.io/)

- npm install -g bower


4)
Create new project using generator
- yo webapp
- Select the options during the process. I have selected “Bootstrap” and “BDD”


















5) 
Install gulp (http://gulpjs.com/). You can build the project using it. 
I have installed gulp locally and globally so you are seeing CLI version and Local version. You may see only CLI version.

- npm install -g gulp


- Check the project structures.


Note :
Since the generator already run "npm install" and "bower install", so you can see the node_modules and bower_components folder with all the installed modules.
** npm will pick from package.json folder
** bower will pick from bower.json
** Any other modules need to be installed for your project then add them to respective package/bower json file and run npm/bower install.

6)
Start the server using gulp. Tasks are present in gulpfile.js

- gulp serve 

** Server will be starting and listen at 9000 port. You can change the port in gulpfile.js file if you want.





No comments:

Post a Comment