Newman/HTML reporter Installation issues

Hello,

Facing issues while installing and executing HTML reports. Listing the steps I followed:

  1. Installed nodejs

C:>node --version

v18.17.1

  1. Installed newman with the command:

install npm -g newman, I get the error

Error: Cannot find module ‘C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\signal-exit\dist\cjs\index.js’

at createEsmNotFoundErr (node:internal/modules/cjs/loader:1098:15)

at finalizeEsmResolution (node:internal/modules/cjs/loader:1091:15)

at resolveExports (node:internal/modules/cjs/loader:567:14)

at Module._findPath (node:internal/modules/cjs/loader:636:31)

at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)

at Module._load (node:internal/modules/cjs/loader:922:27)

at Module.require (node:internal/modules/cjs/loader:1143:19)

at require (node:internal/modules/cjs/helpers:121:18)

at Object.<anonymous> (C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\lib\index.js:5:14)

at Module._compile (node:internal/modules/cjs/loader:1256:14) {

code: ‘MODULE_NOT_FOUND’,

  1. I can however see that newman is installed

C:>newman --version

5.3.2

  1. I am also able to run collection files successfully through Newman

  2. When I install HTML reporter package with the command

npm install -g newman-reporter-htmlextra, I get the error

C:\Users\AppData\Roaming\npm\node_modules\npm\lib\cli.js:48

throw err

^

Error: Cannot find module ‘C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\signal-exit\dist\cjs\index.js’

at createEsmNotFoundErr (node:internal/modules/cjs/loader:1098:15)

at finalizeEsmResolution (node:internal/modules/cjs/loader:1091:15)

at resolveExports (node:internal/modules/cjs/loader:567:14)

at Module._findPath (node:internal/modules/cjs/loader:636:31)

at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)

at Module._load (node:internal/modules/cjs/loader:922:27)

at Module.require (node:internal/modules/cjs/loader:1143:19)

at require (node:internal/modules/cjs/helpers:121:18)

at Object.<anonymous> (C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\gauge\lib\index.js:5:14)

at Module._compile (node:internal/modules/cjs/loader:1256:14) {

code: ‘MODULE_NOT_FOUND’,

path: ‘C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\signal-exit\package.json’

}

Node.js v18.17.1

6)Checked PATH

System Variables:
C:\Program Files\nodejs\

User Variables:
C:\Users\AppData\Roaming\npm

Can’t figure out what’s’ the issue, please help.

Hi @datamom !

Welcome to the community! Let’s see if we can get this working for you :slight_smile:

  1. Clear the npm cache : Clearing the cache might help with any corrupted or outdated files that could be causing the issue.
    npm cache clean -f
    
  2. Uninstall Node.js and npm: Sometimes, it’s best to start with a fresh installation:
  • Uninstall Node.js from your machine.
  • Manually delete the folder C:\Users\AppData\Roaming\npm and C:\Users\AppData\Roaming\npm-cache if they still exist.
  • Reinstall Node.js. As a note, sometimes the LTS (Long Term Support) version is more stable, so you might consider that if you’re on the latest.
  1. Reinstall the global packages: After reinstallation of Node.js and npm, install newman and the HTML reporter:
    npm install -g newman
    npm install -g newman-reporter-htmlextra
    
  2. Use a Node Version Manager: Sometimes, different projects require different Node versions. Using a Node Version Manager like nvm-windows for Windows might help. With it, you can easily switch between Node versions, which might alleviate some of these issues.
  3. Check for any antivirus or firewall restrictions: Sometimes these can interfere with installations, especially when installing global npm modules. If you have any active, try temporarily disabling them and repeating the installation process.

Hope this helps! :slight_smile:

Thanks a lot Kevin for your reply.

  1. Clearing the cache did not help.
  2. Uninstalling and Re-installing did not help either. Getting previous errors
  3. I do have antivirus and firewall restrictions, not disables yet as my computer is connected to a network.

command npm -v is giving me the message:
C:\Users\AppData\Roaming\npm\node_modules\npm\lib\cli.js:48
throw err
^

Error: Cannot find module ‘C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\glob\dist\cjs\src\index.js’
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1098:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1091:15)
at resolveExports (node:internal/modules/cjs/loader:567:14)
at Module._findPath (node:internal/modules/cjs/loader:636:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:121:18)
at Object. (C:\Users\pooja\AppData\Roaming\npm\node_modules\npm\node_modules\cacache\lib\util\glob.js:4:24)
at Module._compile (node:internal/modules/cjs/loader:1256:14) {
code: ‘MODULE_NOT_FOUND’,
path: ‘C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\glob\package.json’
}

Node.js v18.17.1

Regards

This looks like a problem with your installation of node.

Have a look at the following link.

node.js - NPM: npm-cli.js not found when running npm - Stack Overflow

It’s a similar issue and is fixed by updating your path environment variable. (A common issue in windows installations).

Thanks for the response Mike,
I have checked the thread as well as the environment system variables:
C:\Program Files\nodejs.

I can successfully check node and newman installation
C:>newman -v
5.3.2

C:>node -v
v18.17.1

All the files shown in the error are present in their respective folders

  1. cli.js (C:\Users\AppData\Roaming\npm\node_modules\npm\lib\cli.js:48)
    throw err
    ^

  2. index.js
    Error: Cannot find module 'C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\glob\dist\cjs\src\index.js

  3. package.json
    code: ‘MODULE_NOT_FOUND’,
    path: ‘C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\glob\package.json’

It’s more than likely related to the version of node that you’re running. As the reporter is getting slightly old now and it’s not been kept inline with all the node versions that have been released, I suspect that there is something in there that’s not compatible with version 18.

Have you tried this with a different version of node? Using the Node Package Manager is the easiest way, that I’ve found, to switch between different node versions.

Hi Danny,
I just removed version 18 and installed an old version of node.

C:>node -v
v16.16.0

Same issue once again.

For time being, I think I will go with CLI.

Feels like we’re having the same conversation twice :joy:

Not really sure what to suggest from here, like I mentioned on the issue you raised on the repo - The reporter is heavily downloaded each week and I haven’t had any installation based issues reported to me, that only leads me to suspect that it’s an environmental problem on your side.

I’m happy to be wrong here though, the last thing I want is someone not being able to use the reporter. :cry:

Yeah Danny, I posted the issue on github as well :slight_smile:

I understand completely, I was looking forward as well, to execute collection runs as HTML/Junit reports.

As you mentioned in the issue, the same thing is happening with other custom reporters so it strongly suggests that it’s an environmental issue with your machine. :sob: