-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Your user is not allowed to open an ICMP socket. Pick one fix:
# 1) allow unprivileged ping for all groups
sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"
# 2) give node the raw socket capability
sudo setcap cap_net_raw+ep $(which node)
# 3) run as root
sudo node app.jsCheck the current range with cat /proc/sys/net/ipv4/ping_group_range. The default 1 0 means nobody is allowed.
You are running on Windows or macOS. Use tcp, http, https, udp or dns there. See Roadmap.
The package is limited to Linux for now, so npm blocks installation on other systems.
The compiled .node file was not found or could not be loaded.
- Check that
gcc,makeandpython3are installed - Rebuild:
npx node-gyp rebuild - On Alpine (musl), a glibc prebuilt binary will not load. Build from source.
ping accepts IP addresses only. Resolve the hostname first, see ICMP-Ping.
No echo reply arrived within 2000 ms. Common reasons:
- The host blocks ICMP (many cloud firewalls do)
- Packet loss or the host is down
- A firewall on your machine drops outgoing ICMP
Compare with the system tool:
ping -c 3 1.1.1.1101 is network unreachable and 113 is no route to host. Check your network connection and routes.
The system ping binary usually has the cap_net_raw capability or the setuid bit set, so it works for normal users. Node does not. Use one of the fixes in the first section.
Containers often drop NET_RAW. Add it back:
docker run --cap-add=NET_RAW your-imageOr allow unprivileged ping inside the container:
docker run --sysctl net.ipv4.ping_group_range="0 2147483647" your-imageICMP
Help