Question

I followed the instructions on Running Unit Tests on the Angular Seed Project, but I get the following error:

scripts/test.sh: line 9: scripts/../node_modules/karma/bin/karma: 
  No such file or directory

Any ideas?

Was it helpful?

Solution

I think I found the issue.

The README says the following:

Requires node.js, Karma (sudo npm install -g karma) and a local or remote browser.

But I checked at scripts/test.sh:

$BASE_DIR/../node_modules/karma/bin/karma start $BASE_DIR/../config/karma.conf.js $*

So it looks like test.sh is looking for karma in the base angular-seed directory.

I did the following:

$> cd angular-seed-master
$> npm install karma
$> karma init
   [... followed instructions ...]
$> scripts/test.sh

And it worked.

Note: It seems the README in Angular Seed Project is outdated as this Issue in Github from 2 months ago explains. This issue should go away soon.

Karma should be loaded from the path - not a relative directory #125

+1, without this the README setup instructions no longer work.

Alternatively the README could be updated to account for local installation as in angular#132 Though note though that package.json also needs a "version" field which is causes npm to error out on npm install for me when installed locally.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top