Reference error KEYUTIL not defined in prerequisit-script

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.

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.

Here’s an outline with best practices for making your inquiry.

My question:
I am running a collection with few calls I have a post request first to get an a signed API key and I use KEYUTIL to get a key in the prerequisite script which works in POSTMAN but not in Newman

Details (like screenshots):

image

How I found the problem:
by running the collection in newman

I’ve already tried:

Hi @Dwarak001
There isn’t very much information to go on here, but I would guess that it’s how the first call is setup.

Does it use global variables (or more specifically a variable declaration that isn’t being used in newman?)

You may find the variable scopes section below useful;