clinicjs / node-clinic

Clinic.js diagnoses your Node.js performance issues
https://clinicjs.org
MIT License
5.67k stars 125 forks source link

Clinic Doctor not generating .html report with node v16 #456

Closed ghost closed 1 year ago

ghost commented 1 year ago

Expected Behavior

I would expect a report to be created and opened in my web browser after closing the application with Ctrl + C.

Current Behavior

Once I close the app I am getting the message: ^C[ ] Received Ctrl+C, closing process.... Then a node_trace.1.log file has been created. It happens only when I run it with npx clinic doctor -- node index but not when I do clinic doctor -- node index. I have confirmed that my local and global versions are the same.

Steps to Reproduce (for bugs)

To run the server I used:

npx clinic doctor -- node index

The server I am running is:

const express = require('express')
const app = express()

app.get('/', function (req, res) {
  res.send('Hello World')
})

app.listen(3000)

Sample upload

Environment

RafaelGSS commented 1 year ago

clinic doctor -- node index works fine for you?

ghost commented 1 year ago

Yes, it does

RafaelGSS commented 1 year ago

I didn't investigate it, but I believe it's because npx should have custom process.on('SIGINT') handlers.

Try manually adding process.on('SIGINT', () => process.exit()) in your code