13

On a locally hosted TFS I'm using the "npm install" build step in my build definition.

On the agent machine I have installed nodejs and can run npm from the command line.

When I attempt to queue the build I get a pop up with the message:

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

So I attempted to add the capability, first by refreshing the agent capabilities and when that had no effect I added a capability:

npm C:\Program Files\nodejs

Then the build starts but the npm step throws the error:

Unable to locate npm

I suspect I have missed something on my agent set up because the agent is not reporting its npm capability?

weston
  • 54,145
  • 21
  • 145
  • 203

2 Answers2

29

I had to restart the VSO agent service, allowing the new capability to be reported.

weston
  • 54,145
  • 21
  • 145
  • 203
  • 1
    By this do you mean got to Services -> VSO Agent (**Agent name **) right click and restart the service? Because this has not worked for me.. – sethreidnz Jan 25 '16 at 10:40
  • 2
    @justsayno yes that is what I meant. In that case, if possible do a full restart. If that doesn't help then I'm afraid you have a different cause to the problem we experienced. – weston Jan 25 '16 at 10:59
  • thank you! But none of this has helped. So frustrating as I have my script working perfectly from the only user on the azure VM. But the only thing I can think is that (although npm is in my system PATH) I had to use the default service account when I created the service with the cmd... I might make another quesiton about this. Thanks – sethreidnz Jan 25 '16 at 11:04
  • @justsayno yes I think that's best. Reference that you've tried what this question says so that people don't try to close as a duplicate. – weston Jan 25 '16 at 11:06
  • On linux, go to your `myagent` directory and restart the service with the commands `sudo ./svc.sh stop; sudo ./svc.sh start`. – BioGeek Jun 02 '16 at 13:58
  • Azure Pipelines Agent (name of your agent) for Azure DevOps – JDNickell Apr 08 '20 at 19:55
  • What are you saying @JDNickell? – weston Apr 09 '20 at 10:59
0

I have installed all missing tools and then restarted the build agent. But this is not working as new capabilities (npm, node, visyal studio etc) are not getting identified by above steps. Finally I restarting the machine and that has resolved this issue for me.