Can not load "PhantomJs", it is not registered!

28,592 views
Skip to first unread message

ruben....@gmail.com

unread,
Nov 13, 2013, 9:52:09 AM11/13/13
to karma...@googlegroups.com
I installed karma and karma-phantomjs-launcher with npm install -g,  and I set
 
   browsers: ['PhantomJs'],

in my karma.conf.js, but when running karma I get the warning

   Can not load "PhantomJs", it is not registered! '

If I use Chrome or Firefox as browser, it works.  What am I doing wrong?

Vojta Jína

unread,
Nov 13, 2013, 6:21:57 PM11/13/13
to karma...@googlegroups.com
Sounds like the karma-phantomjs-launcher plugin is not loaded.

Do you specify "plugins" in your karma.conf.js ? By default (if you don't), Karma loads all the plugins that are siblinks to Karma. 

Maybe you have a local version of Karma installed? In which case you need to install karma-phantomjs-launcher locally too.

V.


--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/karma-users/daae21ef-017d-4877-8851-76deb78a396f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruben Decrop

unread,
Nov 14, 2013, 4:09:41 AM11/14/13
to karma...@googlegroups.com
I have no plugins in my karma.conf.js.  Do I need to have plugins directive?
Both karma and karma-phantomjs-launcher are installed on my development machine with
"sudo npm -g install"

Ruben

Op donderdag 14 november 2013 00:21:57 UTC+1 schreef Vojta Jína:

David Karr

unread,
Nov 15, 2013, 5:52:21 PM11/15/13
to karma...@googlegroups.com


On Thursday, November 14, 2013 1:09:41 AM UTC-8, Ruben Decrop wrote:
I have no plugins in my karma.conf.js.  Do I need to have plugins directive?
Both karma and karma-phantomjs-launcher are installed on my development machine with
"sudo npm -g install"

You have to instal the plugins through npm, but you have to tell Karma that you're going to use those plugins in the "plugins" directive.  Here's an example that uses more plugins than you're specifying:

    plugins:[
             
'karma-jasmine',
             
'karma-requirejs',
             
'karma-coverage',
             
'karma-junit-reporter',
             
'karma-phantomjs-launcher',
             
'karma-chrome-launcher',
             
'karma-firefox-launcher',
             
'karma-ie-launcher'
             
],


 
Here's the page that documents this: http://karma-runner.github.io/0.10/config/plugins.html .

Vojta Jína

unread,
Nov 22, 2013, 11:36:21 AM11/22/13
to karma...@googlegroups.com
Ruben,

as David said, you can explicitly specify plugins you want to load in "plugins" section of your karma.conf.js.

If you don't do that, Karma will load all the modules matching karma-* that are siblinks to karma. So as long as you follow the typical way - have "karma" (and all the plugins you need) installed locally per project, you should not need to specify "plugins". It sounds like you have Karma installed locally and the plugins globally or something and so Karma does not find it.

V.


Ruben Decrop

unread,
Nov 26, 2013, 12:41:16 PM11/26/13
to karma...@googlegroups.com
I did a clean install of OSX Mavericks on my machine, so I am having a clean environment.  After installing node.js, I did a
   sudo npm -g install karma
   sudo npm -g install karma-phantomjs-launcher
but again I get the message that PhantomJs is not registered when I launch karma.  After adding the plugins directive in my karma.conf.js as David described,  the same error message was shown.  Are there any debug options I can give to karma to see what is happening?

Although I am continuing to test with Firefox or Chrome, I would prefer to test with PhantomJs because it only requires a command line


Vojta Jína

unread,
Nov 29, 2013, 12:12:55 PM11/29/13
to karma...@googlegroups.com
Ruben, you can run Karma with --log-level debug and it will print out which plugins are loaded during the bootstrap (including what bindings these plugins define).

V.


--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.

Ruben Decrop

unread,
Dec 8, 2013, 9:31:28 AM12/8/13
to karma...@googlegroups.com

I tried again this weekend using a local Karma installation and still got the issue.  Then I copied an existing test example with locally stored Karma + working PhantomJs launcher and after that I finally got it working.
Why it did not work before remains a mystery to me, because I could not detect any difference in the local karma installation.

Anyway thanks for the help

Op vrijdag 29 november 2013 18:12:55 UTC+1 schreef Vojta Jína:

moort...@gmail.com

unread,
Mar 25, 2014, 5:11:34 PM3/25/14
to karma...@googlegroups.com
Late response!

Ruben: since you are trying to install globally, make sure the environment (PATH) variables are set correctly.

mcca...@gmail.com

unread,
May 7, 2014, 10:04:20 PM5/7/14
to karma...@googlegroups.com, moort...@gmail.com
Well, since this thread is back from the dead and I just ran into it myself today:

It's PhantomJS, not PhantomJs.  Note the capitalization.

Mike

unread,
Aug 11, 2015, 2:13:33 PM8/11/15
to karma-users
Thanks, this solved my problem, I just needed to install karma-phantomjs-launcher  locally!
Reply all
Reply to author
Forward
0 new messages