{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/pm2/issues/3847","repository_url":"https://api.github.com/repos/Unitech/pm2","labels_url":"https://api.github.com/repos/Unitech/pm2/issues/3847/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/pm2/issues/3847/comments","events_url":"https://api.github.com/repos/Unitech/pm2/issues/3847/events","html_url":"https://github.com/Unitech/pm2/issues/3847","id":348446318,"node_id":"MDU6SXNzdWUzNDg0NDYzMTg=","number":3847,"title":"Error caught while calling pidusage. spawn ps ENOENT","user":{"login":"VivienAdnot","id":9721157,"node_id":"MDQ6VXNlcjk3MjExNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/9721157?v=4","gravatar_id":"","url":"https://api.github.com/users/VivienAdnot","html_url":"https://github.com/VivienAdnot","followers_url":"https://api.github.com/users/VivienAdnot/followers","following_url":"https://api.github.com/users/VivienAdnot/following{/other_user}","gists_url":"https://api.github.com/users/VivienAdnot/gists{/gist_id}","starred_url":"https://api.github.com/users/VivienAdnot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VivienAdnot/subscriptions","organizations_url":"https://api.github.com/users/VivienAdnot/orgs","repos_url":"https://api.github.com/users/VivienAdnot/repos","events_url":"https://api.github.com/users/VivienAdnot/events{/privacy}","received_events_url":"https://api.github.com/users/VivienAdnot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-07T18:57:18Z","updated_at":"2018-08-07T21:17:01Z","closed_at":"2018-08-07T21:17:01Z","author_association":"NONE","body":"## What's going wrong?\r\n\r\nSince I upgraded pm2 to 3.0.3: when I start any of my node apps, when I go to pm2 logs, I see this error:\r\n\r\n```\r\nPM2 error: Error caught while calling pidusage\r\nPM2 error: Error: Error: spawn ps ENOENT\r\n```\r\n\r\n## How could we reproduce this issue?\r\n\r\nThe code is very small, I have an index.js file:\r\n\r\n```\r\nconst fs = require('fs');\r\nconst filename = 'target.txt';\r\nfs.watch(filename, () => console.log(`file ${filename} just changed`));\r\nconsole.log(`Now watching ${filename} for changes...`);\r\n```\r\nthen I have a package.json:\r\n\r\n```\r\n{\r\n  \"main\": \"index.js\",\r\n  \"scripts\": {\r\n    \"start\": \"pm2 start ecosystem.config.js\"\r\n  },\r\n}\r\n```\r\n\r\nand I generated my pm2 config file with pm2 init:\r\n\r\n```\r\nmodule.exports = {\r\n  apps : [{\r\n    name      : 'API',\r\n    script    : 'index.js',\r\n    env: {\r\n      NODE_ENV: 'development'\r\n    },\r\n    env_production : {\r\n      NODE_ENV: 'production'\r\n    }\r\n  }]\r\n};\r\n```\r\n\r\nIf I run the same program with `node index.js` or `nodemon index.js`, I have no problem.\r\n\r\n## Supporting information\r\n\r\n```\r\n===============================================================================\r\n--- PM2 REPORT (Tue Aug 07 2018 20:52:05 GMT+0200 (CEST)) ---------------------\r\n===============================================================================\r\n--- Daemon -------------------------------------------------\r\npm2d version         : 3.0.3\r\nnode version         : 8.11.3\r\nnode path            : /usr/local/lib/node_modules/pm2/bin/pm2\r\nargv                 : /usr/local/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js\r\nargv0                : node\r\nuid                  : 501\r\ngid                  : 20\r\nuptime               : 130min\r\n===============================================================================\r\n--- CLI ----------------------------------------------------\r\nlocal pm2            : 3.0.3\r\nnode version         : 8.11.3\r\nnode path            : /usr/local/bin/pm2\r\nargv                 : /usr/local/bin/node,/usr/local/bin/pm2,report\r\nargv0                : node\r\nuid                  : 501\r\ngid                  : 20\r\n===============================================================================\r\n--- System info --------------------------------------------\r\narch                 : x64\r\nplatform             : darwin\r\ntype                 : Darwin\r\ncpus                 : Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz\r\ncpus nb              : 4\r\nfreemem              : 51929088\r\ntotalmem             : 8589934592\r\n===============================================================================\r\n--- PM2 list -----------------------------------------------\r\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬────────┬─────────────┬──────────┐\r\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem    │ user        │ watching │\r\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼────────┼─────────────┼──────────┤\r\n│ API      │ 0  │ fork │ 14821 │ online │ 0       │ 8m     │ 0%  │ 0 B    │ vivienadnot │ disabled │\r\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴────────┴─────────────┴──────────┘\r\n===============================================================================\r\n--- Daemon logs --------------------------------------------\r\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬────────┬─────────────┬──────────┐\r\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem    │ user        │ watching │\r\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼────────┼─────────────┼──────────┤\r\n│ API      │ 0  │ fork │ 14821 │ online │ 0       │ 8m     │ 0%  │ 0 B    │ vivienadnot │ disabled │\r\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴────────┴─────────────┴──────────┘\r\n```\r\n\r\nThank you for your help guys"},"comment":{"url":"https://api.github.com/repos/Unitech/pm2/issues/comments/411205497","html_url":"https://github.com/Unitech/pm2/issues/3847#issuecomment-411205497","issue_url":"https://api.github.com/repos/Unitech/pm2/issues/3847","id":411205497,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTIwNTQ5Nw==","user":{"login":"wallet77","id":5022887,"node_id":"MDQ6VXNlcjUwMjI4ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/5022887?v=4","gravatar_id":"","url":"https://api.github.com/users/wallet77","html_url":"https://github.com/wallet77","followers_url":"https://api.github.com/users/wallet77/followers","following_url":"https://api.github.com/users/wallet77/following{/other_user}","gists_url":"https://api.github.com/users/wallet77/gists{/gist_id}","starred_url":"https://api.github.com/users/wallet77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallet77/subscriptions","organizations_url":"https://api.github.com/users/wallet77/orgs","repos_url":"https://api.github.com/users/wallet77/repos","events_url":"https://api.github.com/users/wallet77/events{/privacy}","received_events_url":"https://api.github.com/users/wallet77/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T21:17:01Z","updated_at":"2018-08-07T21:17:01Z","author_association":"COLLABORATOR","body":"I think it was an old issue with older pidusage version.\r\nnpm probably cached it."}}
{"actor":{"display_login":"wallet77"}}