yeoman / generator-angular

Yeoman generator for AngularJS
http://yeoman.io
5.73k stars 1.44k forks source link

Karma task isn't added to Gruntfile when --coffee is specified #793

Open jonniespratley opened 10 years ago

jonniespratley commented 10 years ago

To reproduce:

$ yo angular --coffee
$ grunt test
Warning: Task "karma" not found. Use --force to continue.

Aborted due to warnings.

Execution Time (2014-07-23 20:35:46 UTC)
loading tasks  6ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 86%
Total 7ms
sanketsahu commented 10 years ago

And so, I installed karma manually

$ npm install grunt-karma --save-dev

eddiemonge commented 10 years ago

Yeah this is probably a bug, but more likely a bug in generator-karma since if coffee is specified it won't automatically insert a config block into a Gruntfile.js file.

eddiemonge commented 10 years ago

Solution is probably to spit out a note at the end of the process saying to add the config block yourself.

@sanketsahusoft that doesn't solve this issue.

cjerdonek commented 10 years ago

This also occurred for me, but even without using --coffee. I was using version 0.9.5 of the generator without any command-line arguments, and without Sass and with Bootstrap.

eddiemonge commented 10 years ago

@cjerdonek is that still happening without --coffee? It shouldn't be.

cjerdonek commented 10 years ago

@eddiemonge Yep, I tried it again, and this time with generator-angular 0.9.8. Let me know if there's any additional info you'd like to know.

cjerdonek commented 10 years ago

By the way, I seemed to have a whole host of problems on the bower install & npm install stage of running the generator (it's saying I need to run the commands as root/Administrator which doesn't seem right). So I just inspected package.json manually.

eddiemonge commented 10 years ago

you probably setup npm to use a place you dont have permissions, or the folder you are generating in doesnt

cjerdonek commented 10 years ago

It looks like the .npm folder of my home directory doesn't have the proper permissions. But I don't recall changing anything from what npm does automatically. Anyway, I don't want to distract from the current issue.

eddiemonge commented 10 years ago

do you ever do sudo npm install?`

cjerdonek commented 10 years ago

Only when installing something globally with the -g flag.

eddiemonge commented 10 years ago

You shouldn't need to do that either. You should set your npm prefix to a place you have write access to

cjerdonek commented 10 years ago

Okay, thanks. Really good to know. I've gotten conflicting impressions of that over the time I've been learning about npm, e.g. https://github.com/npm/npm#more-details and https://github.com/npm/npm/issues/3139

I'll play around with things to avoid needing sudo.

batista commented 9 years ago

:+1: same issue here with v0.10.0 and no --coffee flag.

to reproduce: new $ yo angular myprojproject with all the default options and then imediately run $ grunt test gives a Warning: Task "karma" not found. Use --force to continue.

do you ever do sudo npm install?`

nope

manually adding the grunt-karma and karma packages to devdependencies in package.json (like in this patch) and then running again npm install solved the issue for me.

eddiemonge commented 9 years ago

@batista Your issue isnt the same one as here since without --coffee the tasks arent added. You probably had npm issues somewhere in the generation.

krishpop commented 9 years ago

I was able to fix it after reinstalling grunt-karma, karma, and karma-jasmine

toymachiner62 commented 9 years ago

:+1: