ping命令在部署后不起作用,尽管它在本地起作用

发布于 2025-01-23 16:20:53 字数 368 浏览 1 评论 0原文

我的ping应用程序在本地运作良好,但是在部署(Heroku)中,我得到了错误:

命令失败:ping -c 1 google.com/bin/sh:1:ping:找不到

你能解释为什么吗?以及如何解决这个问题?

我在服务器中有一个:

let {stdout, stderr} = await exec(`ping -c ${ req.body.packeges} ${req.body.url}`);

以及发送给客户端的响应。因此,我正在执行服务器中的ping命令(node.js)。

后端:node.js 前端:ReactJS

谢谢

My ping application works perfectly locally, but in deployment (Heroku), I get the error:

Command failed: ping -c 1 google.com /bin/sh: 1: ping: not found

can you explain why? and how to fix this?

I have this in the server:

let {stdout, stderr} = await exec(`ping -c ${ req.body.packeges} ${req.body.url}`);

and the response I send to the client. so I'm doing the ping command in the server (Node.js).

backend: Node.js
Frontend: Reactjs

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文