跳至内容

执行命令节点常见问题#

以下是Execute Command节点常见错误和问题及其解决方法或排查步骤。

命令执行失败: /bin/sh: : 未找到#

当shell环境无法找到Command参数中的某个命令时,会出现此错误。

要修复此错误,请检查以下内容:

  • 检查Command参数中的命令及其参数是否有拼写错误。
  • 检查命令是否在运行n8n的用户PATH环境变量中。
  • 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已在运行:
      1
      2
      3
      4
      # 查找n8n的容器ID,它将是第一列
      docker ps | grep n8n
      # 尝试在运行的容器内执行命令
      docker container exec  
      
    • 如果n8n未运行:
      1
      2
      3
      # 启动一个新容器来运行命令而非n8n
      # 使用与正常运行n8n时相同的镜像和标签
      docker run -it --rm --entrypoint /bin/sh docker.n8n.io/n8nio/n8n -c 
      

错误:标准输出缓冲区长度超出限制#

当您的命令返回的输出超过Execute Command节点一次能处理的量时,会出现此错误。

为避免此错误,请减少命令产生的输出。检查命令的手册页或文档,查看是否有标志可以限制或过滤输出。如果没有,可能需要将输出通过管道传递给另一个命令以移除不必要的信息。

优云智算