angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Warning: Task "karma" not found #44

Closed ghost closed 10 years ago

ghost commented 10 years ago

When i run

$ grunt test

I receive the warning

Warning: Task "karma" not found. Use --force to continue.

Then

Aborted due to warnings.

I have installed karma as when i run

$ which karma

I get the output

/usr/local/bin/karma

I have tried installing karma as a node_module to the local directory without any luck.

Once thing that might be worth noting is that when running

$ npm ls

I receive the following errors

npm ERR! extraneous: karma-chrome-launcher@0.1.2 /Users/mrtomstone/Dev/bind/node_modules/karma-chrome-launcher npm ERR! extraneous: karma-firefox-launcher@0.1.3 /Users/mrtomstone/Dev/bind/node_modules/karma-firefox-launcher npm ERR! extraneous: karma-html2js-preprocessor@0.1.0 /Users/mrtomstone/Dev/bind/node_modules/karma-html2js-preprocessor npm ERR! extraneous: karma-jasmine@0.1.5 /Users/mrtomstone/Dev/bind/node_modules/karma-jasmine npm ERR! extraneous: karma-ng-html2js-preprocessor@0.1.0 /Users/mrtomstone/Dev/bind/node_modules/karma-ng-html2js-preprocessor npm ERR! extraneous: karma-ng-scenario@0.1.0 /Users/mrtomstone/Dev/bind/node_modules/karma-ng-scenario npm ERR! extraneous: karma-requirejs@0.2.1 /Users/mrtomstone/Dev/bind/node_modules/karma-requirejs npm ERR! extraneous: karma-script-launcher@0.1.0 /Users/mrtomstone/Dev/bind/node_modules/karma-script-launcher npm ERR! extraneous: karma-coffee-preprocessor@0.1.2 /Users/mrtomstone/Dev/bind/node_modules/karma-coffee-preprocessor npm ERR! extraneous: grunt-karma@0.6.2 /Users/mrtomstone/Dev/bind/node_modules/grunt-karma npm ERR! extraneous: karma-phantomjs-launcher@0.1.1 /Users/mrtomstone/Dev/bind/node_modules/karma-phantomjs-launcher npm ERR! not ok code 0

Also, these modules do not seem to be listed in the package.json file.

Thanks

DaftMonk commented 10 years ago

Please post your package.json.

ghost commented 10 years ago

{ "name": "bind", "version": "0.0.0", "dependencies": { "express": "~3.4.3", "mongoose": "~3.5.5", "async": "~0.2.9", "ejs": "~0.8.4" }, "devDependencies": { "grunt": "~0.4.2", "grunt-autoprefixer": "~0.4.0", "grunt-bower-install": "~0.7.0", "grunt-concurrent": "~0.4.1", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-coffee": "~0.7.0", "grunt-contrib-compass": "~0.6.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-cssmin": "~0.7.0", "grunt-contrib-htmlmin": "~0.1.3", "jpegtran-bin": "0.2.0", "grunt-contrib-imagemin": "~0.3.0", "grunt-contrib-jshint": "~0.7.1", "grunt-contrib-uglify": "~0.2.0", "grunt-contrib-watch": "~0.5.2", "grunt-google-cdn": "~0.2.0", "grunt-newer": "~0.5.4", "grunt-ngmin": "~0.0.2", "grunt-rev": "~0.1.0", "grunt-svgmin": "~0.2.0", "grunt-usemin": "~2.0.0", "jshint-stylish": "~0.1.3", "load-grunt-tasks": "~0.2.0", "time-grunt": "~0.2.1", "grunt-express-server": "~0.4.5", "grunt-open": "~0.2.0", "connect-livereload": "~0.3.0" }, "engines": { "node": ">=0.8.0" }, "scripts": { "test": "grunt test" } }

ghost commented 10 years ago

If I run

$ yo angular-fullstack

I do receive a number of errors throughout the process. Is there a good way to log or strip out these errors?

DaftMonk commented 10 years ago

What kind of errors do you get? Are they related to imagemin or karma?

ghost commented 10 years ago

Ran $yo angular-fullstack to a different location, hence the different path

npm ERR! Error: ENOENT, lstat '/Users/mrtomstone/Dev/bind-admin/node_modules/grunt/lib/grunt/log.js' npm ERR! If you need help, you may report this entire log, npm ERR! including the npm and node versions, at: npm ERR! http://github.com/isaacs/npm/issues npm ERR! System Darwin 13.0.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-karma" "karma-ng-html2js-preprocessor" "karma-ng-scenario" "--save-dev" npm ERR! cwd /Users/mrtomstone/Dev/bind-admin npm ERR! node -v v0.10.24 npm ERR! npm -v 1.3.21 npm ERR! path /Users/mrtomstone/Dev/bind-admin/node_modules/grunt/lib/grunt/log.js npm ERR! fstream_path /Users/mrtomstone/Dev/bind-admin/node_modules/grunt/lib/grunt/log.js npm ERR! fstream_type File npm ERR! fstream_class FileWriter npm ERR! code ENOENT npm ERR! errno 34 npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26 npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)

ghost commented 10 years ago

Writing location.js file PhantomJS is already installed at /usr/local/bin/phantomjs. npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/mrtomstone/Dev/bind-admin/npm-debug.log npm ERR! not ok code 0

ghost commented 10 years ago

Very strange. I just deleted everything from the directory, then ran $ yo angular-fullstack again without any errors, just warnings. Now grunt test runs with one warning

WARN [watcher]: Pattern "/Users/mrtomstone/Dev/bind-admin/test/mock/*/.js" does not match any file.

DaftMonk commented 10 years ago

Not sure what caused the failure, but sometimes there are issues installing karma dependencies. Try running npm install grunt-karma karma-ng-html2js-preprocessor karma-ng-scenario --save-dev in your project if you got errors related to karma.