Can anyone tell me how to configure path of node and npm in my pipeline in Azure Devops as variable env sustem, to make make newman run my collection postman json?
I created a pipeline but it does not execute my collection
MyCollection is pushed in my repo, in Azure Devops
As per the newman guide, you need to have
Node.js >= v16installed on the machine, the easiest way to install Newman is using NPM. On DevOps Microsoft-hosted agent, it has Node and NPM preinstalled already, you don't need to configure path of node and npm.Microsoft-hosted agents: windows-2022 as sample below:
Step1: Just simply run
npm install -g newmanto install Newman globally(-gfor globally), it allows you to run it from anywhere.Step2: You can upload the collection.json to DevOps git repo, and specify the json file for the newman command.
DevOps yaml sample:
In addition, there is an extension Newman the cli Companion for Postman, you can use it to run the newman command as well.
You can check similar link for your reference.
PS: If you use
self-hostedagent, you can pre-install the node.js and NPM, system variable should have configured, the DevOps agent can automatically scan them(capability), and invoke them in the task.