Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Karma: Error during loading "karma-phantomjs-launcher" plugin

I am trying to run tests on Centos 7 within the Node.js (6.1.0) environment. After I run

./node_modules/karma/bin/karma --log-level debug start

I get the error message:

Error during loading "karma-phantomjs-launcher" plugin:
Path must be a string. Received null

In karma.conf.js I have mentioned plugins and the browser:

'plugins': ['karma-mocha', 'karma-chai', 'karma-sinon', 'karma-chai-sinon', 'karma-coverage', 'karma-jasmine', 'karma-phantomjs-launcher', 'karma-chrome-launcher', 'karma-babel-preprocessor'],
browsers: ['PhantomJS'],

I also have installed all plugins locally for the project. All other plugins are loaded without a problem.

I have also the same project running on Windows 7 environment without a problem.

like image 470
Andrzej Sawoniewicz Avatar asked May 24 '16 11:05

Andrzej Sawoniewicz


2 Answers

Removing the node_modules directory and re-installing npm packages again helped me:

rm -r node_modules/

or with rimraf:

rimraf node_modules/

and re-adding all dependencies:

npm i
like image 148
Beat Avatar answered Oct 18 '22 18:10

Beat


Since we weren't using phantomjs for testing, I was able to resolve the issue by removing "karma-phantomjs-launcher" from the karma.conf.js

like image 22
jmunsch Avatar answered Oct 18 '22 19:10

jmunsch