执行命令节点常见问题(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 参数中的命令及其参数是否有拼写错误。
- 检查命令是否在运行 n8n 的用户的
PATH中。 -
如果你使用 Docker 运行 n8n,请尝试手动运行命令以检查该命令是否在容器内可用。如果你的命令不包含在容器中,你可能需要使用包含你命令的自定义镜像来扩展官方 n8n 镜像。
-
如果 n8n 已在运行:
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 未运行:
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.