angular-rails-api icon indicating copy to clipboard operation
angular-rails-api copied to clipboard

Error running rails-api command

Open ni-ka opened this issue 11 years ago • 8 comments

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 avatar Jul 09 '14 13:07 ni-ka

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.

ni-ka avatar Jul 09 '14 14:07 ni-ka

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?

joshnuss avatar Jul 09 '14 14:07 joshnuss

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

ni-ka avatar Jul 09 '14 14:07 ni-ka

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 [email protected] 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

joshnuss avatar Jul 09 '14 15:07 joshnuss

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).

ni-ka avatar Jul 09 '14 16:07 ni-ka

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

What's your bower version? mine is 1.2.7

joshnuss avatar Jul 09 '14 17:07 joshnuss

Ok, first difference: I'm using 1.3.7

ni-ka avatar Jul 09 '14 17:07 ni-ka

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

joshnuss avatar Jul 09 '14 17:07 joshnuss