# ENOENT ping command not found

**URL:** <https://discourse.nodered.org/t/enoent-ping-command-not-found/11030>\
**Category:** General\
**Created:** [11 May 2019 20:59 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030 "2019-05-11T20:59:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [11 May 2019 20:59 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/1 "2019-05-11T20:59:03Z")

</div>

Hello  
I have installed the ping contrib on my PLC running node red with the palette.  
I get an error, even if the contrib is really installed.

ENOENT ping command not found

`[{"id":"f2f9771f.7cb348","type":"ping","z":"dac4c565.6941f8","name":"","host":"www.google.com","timer":"20","x":158.51251220703125,"y":725.7249526977539,"wires":[["f66b7aef.64f8a8"]]}]`  
What can it be?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [11 May 2019 21:04 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/2 "2019-05-11T21:04:32Z")

</div>

And did you really restart node-red ?

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [11 May 2019 21:15 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/3 "2019-05-11T21:15:32Z")

</div>

Yes, I really rebooted my PLC.  
I wrote 'really' because the ping node appears correctly in the list of the nodes, and I got a retunr message after install that he node was added.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 May 2019 00:18 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/4 "2019-05-12T00:18:24Z")

</div>

Have you noted the limitations? Do any of them apply to your platform?

> **[node-red/node-red-nodes](https://github.com/node-red/node-red-nodes/tree/master/io/ping)**
>
> Extra nodes for Node-RED. Contribute to node-red/node-red-nodes development by creating an account on GitHub.

This node actually spawns a system command "ping" so if your OS doesn't have that command available, it wont work.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [12 May 2019 05:48 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/5 "2019-05-12T05:48:53Z")

</div>

As pointed out the underlying operating system needs to have a ping command available. If not there by default it may be possible to install one.

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [12 May 2019 12:58 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/6 "2019-05-12T12:58:50Z")

</div>

Hello

The ping work fine in the command line.

It also worked fine when nodered was started a riot. But if I start it as admin, it tells me that ping command is not found.

Envoyé de mon iPhone

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 May 2019 16:08 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/7 "2019-05-12T16:08:42Z")

</div>

Well, for starters, it isn't recommended to run Node-RED (or much else for that matter) as admin/root unless you absolutely have to. There are few, if any reasons to do so with Node-RED.

This is absolutely why ping is failing since the command shell that is spawned won't have the right settings such as paths.

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [15 May 2019 11:09 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/8 "2019-05-15T11:09:23Z")

</div>

Hello  
My $PAT is actually like this :slight\_smile  
`/opt/plcnext/appshome/data/60002172000051/bin:/opt/plcnext/apps/60002172000051/o pt/node-v10.15.3-linux-armv7l/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/ usr/sbin:/sbin:/opt/plcnext/appshome/bin`  
what would be missing so that the generated shell car run the command PING?

PING is a native function, so, what would be the reason why it is not accessible by any user?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 May 2019 14:20 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/9 "2019-05-15T14:20:27Z")

</div>

Is it? It certainly isn't part of BASH. On my Windows Linux Subsystem (Ubuntu), it resides as a binary command:

```bash
$ whereis ping
ping: /bin/ping /usr/share/man/man8/ping.8.gz
$ ls -la /bin/ping
-rwxr-xr-x 1 root root 63K Mar 9 2017 /bin/ping*

```

I would run some other commands from the exec node to identify what you are actually getting from whatever environment exec is inheriting.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [16 May 2019 18:01 UTC](https://discourse.nodered.org/t/enoent-ping-command-not-found/11030/10 "2019-05-16T18:01:40Z")

</div>

Following up on @TotallyInformation's comment, I would run the following commands, first from the command line then from the `exec` node.

```auto
$ echo $PATH
$ whoami
$ which ping

```

Any differences should give you a clue. You mention using `node-red-node-ping` but haven't said whether the ping command works from the `exec` node.
