Create a yoman project from git checkout

I have a problem with building a goman yoman project project. I am trying to do a git checkout of a yeoman project and run grunt serve . Below is a script describing the error

Scenario description:

Person1 created the yoman angularjs project using yo angular . grunt serve works fine on Person1 computer. Person1 pushes the code to git, so other team members can work on it.

The problem occurs when Person2 performs a git check ( git clone <URL> ). The grunt serve command in the extracted copy will give the following error:

$ grunt serve grunt-cli: The grunt command line interface. (v0.1.13) Fatal error: Unable to find local grunt. If you're seeing this message, either a Gruntfile wasn't found or grunt hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide: http://gruntjs.com/getting-started 

I tried: npm install grunt

I got the following error:

 grunt serve Loading "Gruntfile.js" tasks...ERROR >> Error: Cannot find module 'load-grunt-tasks' Warning: Task "serve" not found. Use --force to continue. Aborted due to warnings. 

Tools used:

 $ grunt -version grunt-cli v0.1.13 grunt v0.4.4 $ yo -v 1.1.2 suraj@localhost :testing$ npm -version 1.4.4 

ls -l in the directory

 drwxrwxr-x app -rw-rw-r-- bower.json -rw-rw-r-- Gruntfile.js -rw-rw-r-- karma.conf.js -rw-rw-r-- karma-e2e.conf.js drwxrwxr-x node_modules -rw-rw-r-- package.json drwxrwxr-x test 

I need help with the task of creating a project from git checkout so that I can continue development.

+6
source share
2 answers

Run a simple npm install inside the App-Directory.

The problem is this: Yeoman-Projcet has a lot of npm dependencies, not only grunts itself, but also all tasks and grunts generators. But, of course, you do not need all these packages inside your repository. This was the β€œpackage.json” file: it displays all the packages that Project Project applies to. npm install reads package.json and installs all the necessary packages.

To run the application correctly, you also need to run bower install . Bower for Frontend-Packages, which is npm for node. "bower install" searches for dependent packages in the file "bower.json" -File and installs them.

+9
source

Solved in 2 steps. The following commands:

  • npm install
  • bower installation

Now start the grunt service

 $ grunt serve Running "serve" task Running "clean:server" (clean) task Running "bower-install:app" (bower-install) task Running "concurrent:server" (concurrent) task Running "compass:server" (compass) task directory .tmp/styles/ create .tmp/styles/main.css (8.454s) Compilation took 8.455s Done, without errors. Execution Time (2014-03-13 10:53:01 UTC) compass:server 9.1s β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡β–‡ 100% Total 9.1s Running "autoprefixer:dist" (autoprefixer) task Prefixed file ".tmp/styles/main.css" created. Running "connect:livereload" (connect) task Started connect web server on 127.0.0.1:9000. Running "watch" task Waiting... 

This solves the problem.

Let me know if this can be avoided or done better :)

+6
source

All Articles