Can we run Pre-request script having axios in Postman/Newman CLI

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.
Working with an AI coding agent? The Postman plugin lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

I have API collection which has pre-request script wherein API calls are been done using axios() using create() → then() → catch() methods. Now when we import this collection to Postman API client whether we will be able to run “Pre-request Script” having axios() in postman and also when i tried to run this collection via Newman CLI, getting below error:
image

How i can overcome on this issue, do i need to install any dependent packages in Newman or via npm so that axios() module gets identified and can run my collection via Newman CLI.

Axios() is not part of the Postman Sandbox, so how are you including that library in your pre-request script? Does this work from the Postman Desktop or Web App?

You can run Newman directly by calling its executable, or you can use Newman as a NodeJS library.

Using Newman as a nodejs library | Postman Learning Center