6

I am trying to use a local server as a build agent to build a project. The server already has

  • VS 2015,
  • VS 2017
  • Node 6,7,8 via NVM
  • NPM 4,5,6 via NVM

I can build the project locally via npm build or yarn build.

I have downloaded and configured and registered the private build agent already and I have it in the agent pool in the portal - xxx.visualstudio.com/xxx.

But when I try to schedule a build from the portal the following message is displayed :

No agent could be found with the following capabilities: npm, azureps

What do I need to fix so the build can run locally?

Ognyan Dimitrov
  • 6,026
  • 1
  • 48
  • 70
  • What's your VSTS build definition? And you need to config a private agent in order vsts build by local software https://www.visualstudio.com/en-us/docs/build/actions/agents/v2-windows. – Marina Liu Jul 07 '17 at 09:32
  • Hi, thanks for the response. I have downloaded and configured and registered the private build agent already and I have it in the agent pool in the portal (As presrcribed by the doc you pointed out). The build is comprised of 4 tasks - Git Get Seources->Yarn Install ->Yarn build->AzureBlob File Copy – Ognyan Dimitrov Jul 07 '17 at 10:57

1 Answers1

10

The problem was simple - I did not see where the Capabilities tab was. IMHO Requests and Capabilities are not easily discoverable. I saw it and I set the two variables to true and it started to work even though I did not know for sure if true is the right value.

Another problem was that NVM SYMLINK was not working as expected and the build agent could not find node.exe at all. It was not in the PATH at all. I uninstalled nvm and used only node 8.1.2 with npm 5 in order to make it run.

enter image description here

UPDATE As of today you can add a 'node tool installer' task to your definition - this is the better solution that is available today as D.J. points out in the comment section.

Community
  • 1
  • 1
Ognyan Dimitrov
  • 6,026
  • 1
  • 48
  • 70
  • 2
    You can add a 'node tool installer' task to your definition. this will install node in your agent-tool-cache on first run and you don't need to install it yourself on the build machine. this would be the correct way to solve this – D.J. Nov 22 '18 at 07:57
  • How do you get AzurePS when running as a service? – Jari Turkia Dec 16 '19 at 08:39
  • @JariTurkia : I believe this is applicable to self-hosted agents. – Ognyan Dimitrov Dec 16 '19 at 10:41
  • @OgnyanDimitrov absolutely. What I'm referring to is a self-hosted Deployment Agent running as a Windows Service. – Jari Turkia Dec 17 '19 at 08:50
  • @JariTurkia I have installed the packages for azure powershell/remote management. I had some problems with upgrading from azurerm but I solved them long ago and since then I do not have any problems. I do not remember if I had to install the agent under NT Authority/System or left it with the default. – Ognyan Dimitrov Dec 18 '19 at 11:53
  • 1
    Yeah. I get AzureRM working with PowerShell 5.1 from a Windows Service. What I'm targeting is something modern, PowerShell Core 6.2 as that's what I use for development. – Jari Turkia Dec 19 '19 at 12:30
  • @JariTurkia Is the core version capability still named AzurePs or it is named differently? AzurePsCore or something else? – Ognyan Dimitrov Dec 20 '19 at 07:55
  • 1
    The capability name is unchanged. Detection is based on executing `bin\powershell\Add-AzurePowerShellCapabilities.ps1` on startup. When the detection is run on PowerShell 5.1 without Az-library, it will fail. – Jari Turkia Dec 20 '19 at 07:58