Unable to run tests in Runner and Newman

I have a set of collections and trying to run it in Runner/Newman.

When I run it in Runner, it fails and i could see “SyntaxError | Unexpected token <” as an error.

When I run it in Newman, it fails and the error " SyntaxError in test-script"

I have no clue of this error.

@kamalviji16 Looks like you’re trying to do response.json() and your response BODY basically has HTML OR XML.
You can write a console.log(response) and check the Postman Console regarding your response body.

Internally (Incase it’s an XML / HTML): JSON.parse is trying to parse the response body and is failing while parsing the HTML / XML.

Edit:
Not only the response body. Could be any thing that you’re trying to parse using JSON.parse method.
If you haven’t been able to solve this issue, kindly share the code that you’re trying to work it.