Setting up grunt, bower, angular dev tools after cloning from github

I am trying to clone a project from github, then configure bower and grunt build / dev dependencies. When angular projects are initialized in github, some directories and files have been dumped (as they are specified in the gitignore file). I am trying to figure out how to resurrect all of these files needed to run a project locally (which I find from viewing on github).

After cloning the project, I run the bower command so that it reads through bower.json:

% bower install 

Then I run the grunt commands:

 % npm install -g grunt-cli % npm install grunt --save-dev 

Why is Gruntfile.js not created automatically when these terminal commands are run?

It also freezes up on a boot issue, but which evaporates after I run them:

 % npm install --save-dev connect-livereload % npm install 

When I start a project from scratch using these yoman and grunt commands, it automatically creates Gruntfile.js, and I can successfully run the project to load automatically in the browser:

 % npm install -g generator-angular % yo angular % bower install angular-ui % npm install --save-dev connect-livereload % npm install % grunt test % grunt server % grunt 

But I'm trying to master the technique of cloning a project from github and then locally create the project. I am close, but currently I am also experiencing a problem with missing Gruntfile.js. I would be very grateful for any direction you could provide. All the best,

Ben

+6
source share
2 answers

Using Yeoman

You do not need to clone a project from GitHub.

You just need to create a new (clean) project directory.

 cd /new/project/directory 

(Optional) Update NPM

 npm update -g npm 

Set angular relay race

 npm install -g generator-angular 

Run Forest Forest

 yo angular 

Start the server

 grunt server 

Start building your application, possibly with angular regenerators

 yo angular:controller myController yo angular:directive myDirective yo angular:filter myFilter yo angular:service myService 

Using bower to set front-end dependencies

Finding repositories to install

 bower search dep-name 

or http://sindresorhus.com/bower-components/

See that everything has been installed

 bower list 

or, see bower.json file

Dependency Installation

 bower install dep-name 

or add it to the bower.json file and then just run bower install (preferred)

Most read the documentation

I would recommend reading Yoman first. Take it, then go to other documents if you need a more advanced setup for your project. Typically, Yeoman documents cover the gazebo and grunt in the same way as it relates to your Yeoman project.

+6
source

I work after doing the following:

 brew install nvm source $(brew --prefix nvm)/nvm.sh 

It will install nvm, then you can manage your version of npm (maybe you have a problem with this yo: angular project)

Then you must make sure that you are using npm 0.10

 nvm install 0.10 nvm use 0.10 

To avoid problems with previous npm installations, you should use:

 sudo npm -g cache clean 

Now you are ready to get your yo: angular project running on your computer:

 git clone <yourproject> cd <your-project-directory> npm install 

It will install grunt and karma for you, then you must install all the bower packages before starting your dev server:

 bower install 

Then, finally, your project will work so that you can use:

 grunt serve 

:)

+3
source

Source: https://habr.com/ru/post/953165/


All Articles