joshnuss / angular-rails-api

A template for creating angular+rails apps
52 stars 5 forks source link

Error running rails-api command #1

Open ni-ka opened 10 years ago

ni-ka commented 10 years ago

Haven't digged deaper but I am getting this error:

I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.

   invoke       angular:route
   invoke           angular:controller:/usr/local/lib/node_modules/generator-angular/route/index.js
   create             app/scripts/controllers/about.coffee

/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84
  if (_.isString(componentConfigFile.main)) {
                                    ^
TypeError: Cannot read property 'main' of undefined
    at findMainFiles (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84:37)
    at /usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:146:17
    at forOwn (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:1301:15)
    at Function.forEach (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:2595:9)
    at detectDependencies (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:28:5)
    at wiredep (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/wiredep.js:57:39)
    at Generator._injectDependencies (/usr/local/lib/node_modules/generator-angular/app/index.js:326:5)
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:232:13
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:113:21
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:24:16
ni-ka commented 10 years ago

Also when I execute grunt build or grunt serve I get

localhost:tasks nils$ grunt serve
Running "serve" task
Warning: Task "bowerInstall" not found. Use --force to continue.

Aborted due to warnings.
joshnuss commented 10 years ago

Are you executing grunt serve from the frontend directory

cd frontend
grunt serve

grunt build does require --force because it overwrites ../public which is not a child directory of frontend. Maybe there is a better way to do that.

As far as the "TypeError: Cannot read property 'main' of undefined" what happens when you run bower install & npm install manually? maybe a version thing?

ni-ka commented 10 years ago

Thanks for the quick reply!

Yes, executing from frontent directory. Could it be due to grunt-bower-install beeing deprecated? It is not installed, here are the modules installed:

grunt grunt-autoprefixer grunt-concurrent grunt-connect-proxy grunt-contrib-clean grunt-contrib-coffee grunt-contrib-compass grunt-contrib-concat grunt-contrib-connect grunt-contrib-copy grunt-contrib-cssmin grunt-contrib-htmlmin grunt-contrib-imagemin grunt-contrib-jade grunt-contrib-jshint grunt-contrib-uglify grunt-contrib-watch grunt-filerev grunt-google-cdn grunt-mkdir grunt-newer grunt-ngmin grunt-svgmin grunt-usemin grunt-wiredep

When I try to install it it tells me that wiredep should be used instead

joshnuss commented 10 years ago

Hmm, just tested locally and works fine for me.

What version of grunt are you using? I have

$ grunt --version
grunt-cli v0.1.13
grunt v0.4.5

On Wed, Jul 9, 2014 at 10:47 AM, ni-ka notifications@github.com wrote:

Yes, executing from frontent directory. Could it be due to grunt-bower-install beeing deprecated? It is not installed, here are the modules installed:

grunt grunt-autoprefixer grunt-concurrent grunt-connect-proxy grunt-contrib-clean grunt-contrib-coffee grunt-contrib-compass grunt-contrib-concat grunt-contrib-connect grunt-contrib-copy grunt-contrib-cssmin grunt-contrib-htmlmin grunt-contrib-imagemin grunt-contrib-jade grunt-contrib-jshint grunt-contrib-uglify grunt-contrib-watch grunt-filerev grunt-google-cdn grunt-mkdir grunt-newer grunt-ngmin grunt-svgmin grunt-usemin grunt-wiredep

When I try to install it it tells me that wiredep should be used instead

— Reply to this email directly or view it on GitHub https://github.com/joshnuss/angular-rails-api/issues/1#issuecomment-48481556 .

Joshua Nussbaum

ni-ka commented 10 years ago

I have the same grunt --version grunt-cli v0.1.13 grunt v0.4.5

I reinstalled node / yo / generator-angular and after a couple of runs (!!!) the javascript error is gone. The generator process completes correctly now.

However I still have the problem that grunt-bower-install is not installed, and thus still getting Warning: Task "bower-install" not found. Used --force, continuing (--force does not help either).

joshnuss commented 10 years ago

Is there a frontend/node_modules/grunt-bower-install directory?

What's your bower version? mine is 1.2.7

ni-ka commented 10 years ago

Ok, first difference: I'm using 1.3.7

joshnuss commented 10 years ago

Updated to bower 1.3.7 and it works fine.

Check this: https://github.com/mgcrea/generator-angular-bootstrap/issues/2

Might need to just update the Gruntfile.js