This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Karma configuration not correct on Windows in Tutorial #5498
Closed
Description
In http://docs.angularjs.org/tutorial says to install Karma globally using the -g flag:
npm install -g karma
But then in http://docs.angularjs.org/tutorial/step_02 the test script looks for for karma in the local node-modules and fails
In a separate terminal window or tab, go to the angular-phonecat directory
and run ./scripts/test.sh to start the Karma server (the config file necessary
to start the server is located at ./config/karma.conf.js).
Here's the error:
./scripts/test.sh: line 9: ./scripts/../node_modules/karma/bin/karma: No such file or directory
The offending command in the script is
$BASE_DIR/../node_modules/karma/bin/karma start $BASE_DIR/../config/karma.conf.js $*
However, since I installed karma globally, it was an easy fix, changing that line in the script to
karma start $BASE_DIR/../config/karma.conf.js $*
Fwiw, if I had installed karma locally, the script probably would have worked. In any case, it might be an improvement if the karma install and the karma invocation were in sync.