danielzzz / node-ping

a poor man's ping library (using udp scanning) for node
MIT License
336 stars 105 forks source link

Using node-ping on Heroku #142

Closed andyboltondev closed 2 years ago

andyboltondev commented 3 years ago

Hi,

I am trying to ping a selection of external sites from my node app hosted on Heroku

However I keep getting the following error: 2021-07-17T21:06:49.392815+00:00 app[web.1]: Error: ping.probe: there was an error while executing the ping program. . Check the path or permissions... 2021-07-17T21:06:49.392816+00:00 app[web.1]: at ChildProcess.<anonymous> (/app/node_modules/ping/lib/ping-promise.js:61:19) 2021-07-17T21:06:49.392816+00:00 app[web.1]: at Object.onceWrapper (node:events:514:26) 2021-07-17T21:06:49.392817+00:00 app[web.1]: at ChildProcess.emit (node:events:394:28) 2021-07-17T21:06:49.392818+00:00 app[web.1]: at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12) 2021-07-17T21:06:49.392819+00:00 app[web.1]: at onErrorNT (node:internal/child_process:480:16) 2021-07-17T21:06:49.392819+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:83:21) 2021-07-17T21:06:49.393530+00:00 app[web.1]: Error: Error: ping.probe: there was an error while executing the ping program. . Check the path or permissions... 2021-07-17T21:06:49.393530+00:00 app[web.1]: at /app/controllers/frontend.js:67:21 2021-07-17T21:06:49.393530+00:00 app[web.1]: at runMicrotasks (<anonymous>) 2021-07-17T21:06:49.393531+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:96:5) { 2021-07-17T21:06:49.393531+00:00 app[web.1]: httpStatusCode: 500 2021-07-17T21:06:49.393532+00:00 app[web.1]: }

Any ideas on how to get this working? I am using the standard 'heroku/nodejs' build pack.

It works fine locally with both nodemon and using Heroku CLI heroku local web

Regards, Andy

mondwan commented 3 years ago

According to the error message, it should be Path issues / no ping in the production

You need to check whether you can run ping on the heroku or not.

If ping does exists, you need to check where is it, and specify in the argument

在 2021年7月18日週日 05:13,Andy Bolton @.***> 寫道:

Hi,

I am trying to ping a selection of external sites from my node app hosted on Heroku

However I keep getting the following error: 2021-07-17T21:06:49.392815+00:00 app[web.1]: Error: ping.probe: there was an error while executing the ping program. . Check the path or permissions... 2021-07-17T21:06:49.392816+00:00 app[web.1]: at ChildProcess. (/app/node_modules/ping/lib/ping-promise.js:61:19) 2021-07-17T21:06:49.392816+00:00 app[web.1]: at Object.onceWrapper (node:events:514:26) 2021-07-17T21:06:49.392817+00:00 app[web.1]: at ChildProcess.emit (node:events:394:28) 2021-07-17T21:06:49.392818+00:00 app[web.1]: at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12) 2021-07-17T21:06:49.392819+00:00 app[web.1]: at onErrorNT (node:internal/child_process:480:16) 2021-07-17T21:06:49.392819+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:83:21) 2021-07-17T21:06:49.393530+00:00 app[web.1]: Error: Error: ping.probe: there was an error while executing the ping program. . Check the path or permissions... 2021-07-17T21:06:49.393530+00:00 app[web.1]: at /app/controllers/frontend.js:67:21 2021-07-17T21:06:49.393530+00:00 app[web.1]: at runMicrotasks () 2021-07-17T21:06:49.393531+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:96:5) { 2021-07-17T21:06:49.393531+00:00 app[web.1]: httpStatusCode: 500 2021-07-17T21:06:49.393532+00:00 app[web.1]: }

Any ideas on how to get this working? I am using the standard 'heroku/nodejs' build pack.

It works fine locally with both nodemon and using Heroku CLI heroku local web

Regards, Andy

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/danielzzz/node-ping/issues/142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5YBI3P6C6MKQ5P5SK3CTLTYHXADANCNFSM5ARNVKNA .