Open axetroy opened 8 years ago
I’m having the same issue. Tried scaffolding out a project with yo angular
several times but get the same problem each time.
@axetroy, is that package.json
file from before or after you ran the manual npm install ... --save-dev
command?
Keep in mind, the Grunt file calls tasks that are provided by Grunt plugins, many of which are wrappers for external libraries. In this case, the karma
task in Gruntfile.js
calls a task provided by grunt-karma
, which wraps the functionality provided by the karma
Node package.
I'd suggest you try running npm install grunt-karma --save-dev
and then trying your test
task again.
@ZaLiTHkA , i run yo
and selete Angular
to init the project
it run npm install
by this generator
after i find the command grunt test
fail,then I run the command npm install ... --save-dev
manually wanna to fixed it
grunt test
fail again but npm runt test
success
that mean karma has work
should I load this Plugin manually?
like
require('karma')(grunt);
There's no need to manually require
each plugin, that's already taken care of by jit-grunt
.
Your last message is somewhat unclear as to the steps you took, so let me put it this way instead.. Try the following steps:
yo angular my-project
(unless you've already done this)devDependencies
list in your package.json
file for grunt-karma
npm install grunt-karma --save-dev
package.json
file again (you should see grunt-karma
with a version string of ^0.12.2
)grunt test
againJust for clarification, if npm run test
works but grunt test
does not, then you're definitely missing the Grunt wrapper for the Karma test suite. If you look at the scripts
configuration in your package.json
file and the karma
task in your Gruntfile.js
file, you'll see both options for running tests use the exact same configuration file (test/karma.conf.js
); the only difference is that one command uses the Grunt plugin while the other does not.
i can confirm this is still a bug that you will run into with a current (today) attempt at going through Step 8 of http://yeoman.io/codelab/index.html
As @ZaLiTHkA wrote: it's all about the missing grunt-karma
in the dev-dependencies or in other words, it's fixed by a manual npm install grunt-karma --save-dev
at the moment.
Please fix.
1230
I had find some issues; but it didn't work for me;
I had install all the karma dependencies
and the `generator karma``
and this is my
package.json
after I init a new Project
when I runt
grunt test
occur an errorabout env