I'm using free Azure DevOps and created a release pipeline, purpose is verify the APIs during release,while executing the agent on step 3 its showing error message.
Image Newman Cli
Image Agent Task list and status
Image Error message Newman Cli companion for postman
2025-02-18T17:11:02.9182874Z ##[section]Starting: Newman the Cli Companion for postman 2025-02-18T17:11:02.9208553Z ============================================================================== 2025-02-18T17:11:02.9208921Z Task : Newman the cli Companion for Postman 2025-02-18T17:11:02.9209143Z Description : Using Newman, one can effortlessly run and test a Postman Collections directly from the command-line. Now in a task! 2025-02-18T17:11:02.9209578Z Version : 4.2.0 2025-02-18T17:11:02.9209734Z Author : Carlo Wahlstedt 2025-02-18T17:11:02.9210976Z Help : More Information 2025-02-18T17:11:02.9211365Z ============================================================================== 2025-02-18T17:11:03.3518599Z Collection Source Type is set to file 2025-02-18T17:11:03.3541800Z No specific path to newman, using default of 'newman' 2025-02-18T17:11:03.3704094Z ##[error]Unable to locate executable file: 'newman'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file. 2025-02-18T17:11:03.3751429Z ##[section]Finishing: Newman the Cli Companion for postman
Based on the error message, it appeared that the Newman tool was not correctly installed on your self-hosted pipeline agent. Meanwhile, your npm custom
task could probably be like that in the image below to install Newman as suggested in the extension task document.
I could reproduce the issue, when running the pipeline on my Windows self-hosted agent machine, where the npm tool was installed for my local user account, while the pipeline agent service was running as the Network Service
service account by default.
services.msc
I worked around this issue by changing the agent service to log on as my user account. Then failed release was redeployed and succeeded within the 2nd attempt (without changing anything in the release pipeline).
If possible, you may consider running this pipeline on the Microsoft-hosted agents instead, where the Newman tool is preinstalled.