3

I've just started getting into node.js, running through a few tutorials. I'm just trying out node-supervisor, but am having some trouble getting it running. I'm using express to set up an app, then installing the supervisor package.

Starting the App using:

npm start

Does exactly as I'd expect, everything works as it has done a few times before.

However if I start supervisor (node_module\.bin\supervisor app.js), I get the following message:

Starting child process with 'node app.js'
Program node app.js exited with code 0

I've looked everywhere I can for an answer but am stumped. I'm probably doing something stupid, can anyone help?

Thanks in advance

Here is my current package.json file:

{
  "name": "application-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node ./bin/www",
  },
  "dependencies": {
    "express": "~4.0.0",
    "static-favicon": "~1.0.0",
    "morgan": "~1.0.0",
    "cookie-parser": "~1.0.1",
    "body-parser": "~1.0.0",
    "debug": "~0.7.4",
    "jade": "~1.3.0",
    "less-middleware": "0.1.15",
    "supervisor": "*"
  }
}
xeem
  • 31
  • 3

1 Answers1

9

Reconfigure your package.json. You have to change the start command in scripts before running npm start

Supervisor

"scripts": {
    "start": "supervisor ./bin/www",
}

And a similar change for Nodemon as well,

"scripts": {
    "start": "nodemon ./bin/www",
}
Ragunath Jawahar
  • 18,666
  • 20
  • 102
  • 154