How to fix error “Please set env variable CHROME_BIN” when running Angular.js with grunt

前端 未结 3 779
孤城傲影
孤城傲影 2021-01-22 18:28

I am trying to do unit tests with AngularJS. I already have bower and grunt installed, so I should be able to do the tests. However, when I run \"grunt test\" from the terminal

3条回答
  •  星月不相逢
    2021-01-22 18:49

    The browser binary path varies by OS.

    Changing the path to the Chrome binary:

    $ export CHROME_BIN=/usr/local/bin/my-chrome-build
    

    Changing the path to the Chrome Canary binary:

    $ export CHROME_CANARY_BIN=/usr/local/bin/my-chrome-build
    

    Changing the path to the PhantomJs binary:

    $ export PHANTOMJS_BIN=$HOME/local/bin/phantomjs
    

提交回复
热议问题