Keith Jackson
Keith Jackson

Reputation: 3269

VSTS Hosted Agent 2017 and PhantomJS Not working

I'm migrating a project to dotnet core *.csproj on VSTS and I can't get a viable agent under Hosted2017 that has PhantomJS. Can anyone advise on this?

Neither the classic 'Hosted' or 'Hosted 2017' has PhantomJS explicitly as a capability.

It seems that it works on hosted by adding the following variable...

PHANTOMJS_BIN: C:\NPM\Modules\PhantomJS.cmd

but this is not correct for Hosted 2017

Upvotes: 1

Views: 672

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33728

You can call npm install phantomjs via command line step/task to install phantomjs package.

A simple sample to call phantomjs command:

  1. Npm install (working folder: $(Build.SourcesDirectory); npm command: install; arguments: phantomjs.

  2. Command line (Tool: node_modules\.bin\phantomjs.cmd; Arguments: --help; Working directory: $(Build.SourcesDirectory))

You also can add it to the environment temporary (Just in current session). For example:

  1. Npm install (the same)
  2. PowerShell script (Arguments: -p $(Build.SourcesDirectory)\node_modules\.bin;

Script:

Param(
 [string]$p
)
$env:Path += ";$p"
phantomjs --help

Upvotes: 3

Related Questions