You may take a look at these articles as it seems that you misconfigured your agent pool in the Azure DevOps:
Try to see and adapt the solution for your encountered behavior as it is mentioned in this video:
Example of adding the Capability for your npm in the Agent Pool: