withEnv

supports passing multiple additional environment variables. Try including the path to the casper library as well:

withEnv(['PATH+PHANTOMJS=phantomcss/node_modules/phantomjs/bin/',
         'PATH+CASPERJS=paths/to/casperjs/bin/']) {

Also, double check the paths you passing to withEnv(). You are specifying a relative path in your example above. If you still encounter problems, try specifying the full absolute path to the /bin folder to ensure you have the correct location.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.