If your run script spawns multiple processes, make sure they’re in the same process group so they can be properly cleaned up by using concurrently or a similar tool:
Copy
npm install --save-dev concurrently
Copy
{ "scripts": { "run": "concurrently \"npm run server\" \"npm run worker\"" }}