First, make sure that Node.js is installed on your computer.
Install Karma using npm:
Open WebStorm’ built-in Terminal (on the main menu, choose Tools | Open Terminal) and run
npm install -g karma
to install Karma into your global node_modules directory and create a symlink to its binary.
The recommended approach is to install Karma (and all the plugins your project needs) locally in the project's directory.
npm install karma
Install karma-cli globally:
Use WebStorm’ built-in npm and search for karma-cli, add -g option before hitting Install for global installation.
Or use built-in Terminal to install karma-cli with:
npm install -g karma-cli
To run new tests with Karma, you need to have a Karma configuration file (learn more about it).
Note: WebStorm disables autoWatch in Karma configuration.