0

I am trying to execute a node application through nodemon. I have a index.js file as entry point of my application and a main.js file as:

var nodemon = require('nodemon');
/**
* some setup done
*/
nodemon({}).on('quit', ()=> {...});

with the config nodemon.json as:

{
  "env": {
    ...
  },
  "execMap": {
      "js": "node --inspect --max-old-space-size=4096"
  },
  "watch": [
    "src/server",
    "config",
    "dist"
  ]
}

When i execute the main.js via npm script and run ps command in terminal, I am seeing 2 instances of my node application being run as:

12752 ttys001    0:02.53 /Users/testUser/.nvm/versions/node/v8.17.0/bin/node --inspect --max-old-space-size=4096 index.js
12777 ttys001    0:02.61 /Users/testUser/.nvm/versions/node/v8.17.0/bin/node --inspect --max-old-space-size=4096 --inspect-port=9230 /Users/testUser/projects/nodeProj/index.js

Also I am only able to attach node debugger on PORT 9230 not on 9229! Why is such thing happening?

0 Answers0