执行命令节点常见问题#
¥Execute Command node common issues
以下是 执行命令节点 的一些常见错误和问题,以及解决或故障排除步骤。
¥Here are some common errors and issues with the Execute Command node and steps to resolve or troubleshoot them.
命令失败:<命令> /bin/sh:<命令>:非已找到#
¥Command failed: <command> /bin/sh: <command>: not found
当 shell 环境找不到 Command 参数中的某个命令时,会发生此错误。
¥This error occurs when the shell environment can't find one of the commands in the Command parameter.
要修复此错误,请查看以下内容:
¥To fix this error, review the following:
- 检查命令及其参数中的 Command 参数是否存在拼写错误。
¥Check that the command and its arguments don't have typos in the Command parameter.
- 检查命令是否位于运行 n8n 的用户的
PATH目录中。
¥Check that the command is in the PATH of the user running n8n.
- 如果你使用 Docker 运行 n8n,请尝试手动运行该命令,以检查该命令在容器内是否可用。如果你的命令未包含在容器中,你可能需要使用包含你的命令的 自定义镜像 文件扩展官方 n8n 镜像。
¥If you are running n8n with Docker, check if the command is available within the container by trying to run it manually. If your command isn't included in the container, you might have to extend the official n8n image with a custom image that includes your command.
-
如果 n8n 已在运行:
¥If n8n is already running:
1 2 3 4
# Find n8n's container ID, it will be the first column docker ps | grep n8n # Try to execute the command within the running container docker container exec <container_ID> <command_to_run> -
如果 n8n 未运行:
¥If n8n isn't running:
1 2 3
# Start up a new container that runs the command instead of n8n # Use the same image and tag that you use to run n8n normally docker run -it --rm --entrypoint /bin/sh docker.n8n.io/n8nio/n8n -c <command_to_run>
错误:stdout 最大缓冲区长度已超出#
¥Error: stdout maxBuffer length exceeded
当你的命令返回的输出超过“执行命令”节点一次能够处理的输出数量时,会发生此错误。
¥This error happens when your command returns more output than the Execute Command node is able to process at one time.
为避免此错误,请减少命令的输出。请查看命令的手册页或文档,了解是否有用于限制或过滤输出的标志。否则,你可能需要将输出通过管道传递给另一个命令以删除不需要的信息。
¥To avoid this error, reduce output your command produces. Check your command's manual page or documentation to see if there are flags to limit or filter output. If not, you may need to pipe the output to another command to remove unneeded info.