Skip to content

ERR_REQUIRE_ESM with jose 6.x - postman-runtime compatibility #3325

@hwangja1019

Description

@hwangja1019

Newman fails with ERR_REQUIRE_ESM when jose 6.x is installed due to postman-runtime trying to require() an ES module.

Error Location:
postman-runtime/lib/authorizer/asap.js:1:12

Current Behavior:

  • Compatibility issue using jose 6.x.
    C:...node_modules\postman-runtime\lib\authorizer\asap.js:1
    var jose = require('jose'),
    Error [ERR_REQUIRE_ESM]: require() of ES Module C:...node_modules\jose\dist\webapi\index.js from C:...node_modules\postman-runtime\lib\authorizer\asap.js not supported.
    Instead change the require of index.js in C:...node_modules\postman-runtime\lib\authorizer\asap.js to a dynamic import() which is available in all CommonJS modules.

Expected Behavior
Newman tests to run successfully

Impact:

  • Prevents Newman from running in projects using jose 6.x
  • Affects CI/CD pipelines using Newman for API testing

Environment:

  • Newman version: 6.2.1
  • Node.js version: 18.20.4
  • OS: Windows

Suggested Fix:
Update postman-runtime to use dynamic import() for jose

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions