TFS build agent cannot locate npm
Asked Answered
E

2

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?

Espagnole answered 1/12, 2015 at 11:17 Comment(0)
E
29

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

Espagnole answered 1/12, 2015 at 11:21 Comment(6)
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..Glaab
@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.Espagnole
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. ThanksGlaab
@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.Espagnole
On linux, go to your myagent directory and restart the service with the commands sudo ./svc.sh stop; sudo ./svc.sh start.Corso
What are you saying @JDNickell?Espagnole
E
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.

Enschede answered 8/7, 2022 at 1:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.