Search code examples
node.jsnpmforever

How to make a npm stop that terminates the correct forever


I am using forever in npm start to start the node.js app, and I would like to have a npm stop to terminate the task. How can I stop the right task? I really like to not use stop all


Solution

  • Normally you want to assing a uid and then stop the process based on assign name, for example: 1. Starting: forever start --uid=myapp index.js 2. Stopping only myapp: forever stop myapp