# Error: Cannot find module 'newman' Require stack:

**URL:** <https://community.postman.com/t/error-cannot-find-module-newman-require-stack/8749>\
**Category:** Help Hub\
**Created:** [November 1, 2019, 8:21pm UTC](https://community.postman.com/t/error-cannot-find-module-newman-require-stack/8749 "2019-11-01T20:21:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdang](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jdang](https://community.postman.com/u/jdang)\
**Post date:** [November 1, 2019, 8:21pm UTC](https://community.postman.com/t/error-cannot-find-module-newman-require-stack/8749/1 "2019-11-01T20:21:30Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, 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](https://github.com/postmanlabs/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](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

Hi Everyone,

I just installed newman and **able to run postman-collection test cases with the command line**.  
However, when I try to create NodeJs script the following statement  
**const newman = require(‘newman’);** // require newman in your project  
throws exception  
_Error: Cannot find module ‘newman’_  
_Require stack:_

I am not sure how to fix this problem. Any help is appreciated.

JDang

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [November 1, 2019, 9:31pm UTC](https://community.postman.com/t/error-cannot-find-module-newman-require-stack/8749/2 "2019-11-01T21:31:30Z")

</div>

Hey @jdang

Welcome to the community!! ⭐

Do you have a `package.json` file with Newman as one of the dependencies?

If you have that in place in the same directory as the script, you can use the `npm i -S newman` to install the `node_modules`.

Once that’s been installed, you should be able to run the script again.

---

<div class="post-metadata">

**Author:** ![jdang](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jdang](https://community.postman.com/u/jdang)\
**Post date:** [November 4, 2019, 3:38pm UTC](https://community.postman.com/t/error-cannot-find-module-newman-require-stack/8749/3 "2019-11-04T15:38:10Z")

</div>

Thanks, I need to have package.json then install newman locally.

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [November 6, 2019, 12:10pm UTC](https://community.postman.com/t/error-cannot-find-module-newman-require-stack/8749/4 "2019-11-06T12:10:22Z")

</div>

If you have installed newman globally and you get the error _“Error: Cannot find module ‘newman’”_ , probably your NODE\_PATH is misconfigured.

Please check the following link to get this fixed: [https://stackoverflow.com/a/14515868/766177](https://stackoverflow.com/a/14515868/766177)
