Issue while running script newman script on Octopus Server

Hello,

I have installed nodeJs and newman on Octopus server. I am able to successfully run Postman collection using newman by logging into Octopus Server. I have saved collection file on particular folder and I tried running powershell which does “newman run” of my postman collection. I have also ensured paths and postman collections, variables etc. are present.

After I was able to successfully run newman on Octopus Server, I tried running it during Octopus Deployment process by adding ‘Run a Script’ step. I ensured that powershell reaches out to correct path in Octopus Server. However, I am getting ‘‘newman’ is not recognized as an internal or external command’ error in deployment step.

I also logged in to Octopus Server and used Calamari.exe run-script --script “filePath” to check if I can run script using Calamari, and I was able to run it successfully using Calamari.

It seems to break only from Octopus web portal.

Could you please let me know if I am missing something here?

Thanks,
Nachiket Lotlikar

I was able to figure this out myself. If I am running directly on server below command worked

Running Directly in PowerShell
newman run “collectionPath”

Running using Calamari run-script
Calamari.exe run-script --script=“pathToPowerShell”

In order to run this using Octopus Portal, I had to do below
cd C:\PostmanCollection\node_modules\newman\bin
node newman run “collectionPath”

It seems Calamari was not able to run node modules directly.