title: Can't start laravel-echo-server with supervisor
body: <p>I have already referenced all of the other suggestions that people have made on other posts, nothing has worked.</p>
  <h1>Paths to Relevant Files</h1>
  <p>The root directory of my project is <code>/var/www/html</code> and that is where I have <code>.env</code> and <code>laravel-echo-server.json</code>.</p>
  <p>I have laravel-echo-server installed globally. I can run it successfully from a with <code>laravel-echo-server start --dir=/path/to/project/root</code></p>
  <p>When I run <code>which laravel-echo-server</code>, it shows its path is <code>~/.nvm/versions/node/v13.5.0/bin/laravel-echo-server</code>.</p>
  <p>Likewise, the path for node is <code>~/.nvm/versions/node/v13.5.0/bin/node</code></p>
  <p>My conf file for the supervisor worker is at <code>/etc/supervisor/conf.d/laravel-echo-server.conf</code>.</p>
  <p>Supervisor runs the other workers successfully, such as Horizon, so it is not a problem with the supervisor configuration.</p>
  <h1>Conf File</h1>
  <pre><code>[program:laravel-echo-server]
  process_name=%(program_name)s_%(process_num)02d
  command=laravel-echo-server start --dir=/var/www/html
  autostart=true
  numprocs=1
  user=root
  autorestart=true
  stdout_logfile=/var/log/workers/laravel-echo-server.log
  </code></pre>
  <p>I have also tried the following variations for the command line:</p>
  <pre><code>command=/usr/bin/laravel-echo-server start --dir=/var/www/html
  command=~/.nvm/versions/node/v13.5.0/bin/laravel-echo-server --dir=/var/www/html
  </code></pre>
  <p>All of these attempts and variations return <code>ERROR (no such file)</code>.</p>
  <p>I also tried making duplicate copies of laravel-echo-server.json to place in locations like <code>/usr/bin</code> and <code>/etc/supervisor/conf.d</code> but that didn't help.</p>
  <p>I also tried changing the user from <code>root</code> to <code>ec2-user</code> (which is my username with which I can successfully initialize laravel-echo-server from the command line).</p>
  <p>I have also tried adding another line: <code>directory=/var/www/html</code> but that doesn't help.</p>
  <h1>Shell Executable Attempt</h1>
  <p>I tried to make a shell executable file that supervisor could call. Here is the file:</p>
  <pre><code>#!/bin/bash
  exec laravel-echo-server start --dir=../../../var/www/html
  </code></pre>
  <p>I called the executable with supervisor like this:</p>
  <pre><code>command=bash -c laravel-echo-server.sh
  </code></pre>
  <p>But it returned <code>ERROR (spawn error)</code>.</p>
  <h1>Additional Info</h1>
  <h3>supervisord.conf</h3>
  <pre><code>[inet_http_server]
  port=*:9001
  
  [unix_http_server]
  file=/var/run/supervisor.sock   ; (the path to the socket file)
  chmod=0700                       ; sockef file mode (default 0700)
  
  [rpcinterface:supervisor]
  supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
  
  [supervisord]
  ;http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
  ;http_port=127.0.0.1:9001  ; (alternately, ip_address:port specifies AF_INET)
  ;sockchmod=0700              ; AF_UNIX socketmode (AF_INET ignore, default 0700)
  ;sockchown=nobody.nogroup     ; AF_UNIX socket uid.gid owner (AF_INET ignores)
  ;umask=022                   ; (process file creation umask;default 022)
  logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
  logfile_maxbytes=50MB       ; (max main logfile bytes b4 rotation;default 50MB)
  logfile_backups=10          ; (num of main logfile rotation backups;default 10)
  loglevel=info               ; (logging level;default info; others: debug,warn)
  pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
  nodaemon=false              ; (start in foreground if true;default false)
  minfds=1024                 ; (min. avail startup file descriptors;default 1024)
  minprocs=200                ; (min. avail process descriptors;default 200)
  
  ;nocleanup=true              ; (don't clean up tempfiles at start;default false)
  ;http_username=user          ; (default is no username (open system))
  ;http_password=123           ; (default is no password (open system))
  ;childlogdir=/tmp            ; ('AUTO' child log dir, default $TEMP)
  ;user=chrism                 ; (default is current user, required if root)
  ;directory=/tmp              ; (default is not to cd during start)
  ;environment=KEY=value       ; (key value pairs to add to environment)
  
  [supervisorctl]
  serverurl=unix:///var/run/supervisor.sock
  ;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
  ;username=chris              ; should be same as http_username if set
  ;password=123                ; should be same as http_password if set
  ;prompt=mysupervisor         ; cmd line prompt (default &quot;supervisor&quot;)
  
  [include]
  files = /etc/supervisor/conf.d/*.conf
  </code></pre>
  <h3>laravel-echo-server.json</h3>
  <pre><code>{
      &quot;authHost&quot;: http://mywebsite.com,
      &quot;authEndpoint&quot;: &quot;/broadcasting/auth&quot;,
      &quot;clients&quot;: [],
      &quot;database&quot;: &quot;redis&quot;,
      &quot;databaseConfig&quot;: {
          &quot;redis&quot;: {[my redis credentials]},
          &quot;sqlite&quot;: {
              &quot;databasePath&quot;: &quot;/database/laravel-echo-server.sqlite&quot;
          }
      },
      &quot;devMode&quot;: true,
      &quot;host&quot;: null,
      &quot;port&quot;: &quot;6001&quot;,
      &quot;protocol&quot;: &quot;http&quot;,
      &quot;socketio&quot;: {},
      &quot;sslCertPath&quot;: &quot;&quot;,
      &quot;sslKeyPath&quot;: &quot;&quot;,
      &quot;sslCertChainPath&quot;: &quot;&quot;,
      &quot;sslPassphrase&quot;: &quot;&quot;,
      &quot;subscribers&quot;: {
          &quot;http&quot;: true,
          &quot;redis&quot;: true
      },
      &quot;apiOriginAllow&quot;: {
          &quot;allowCors&quot;: false,
          &quot;allowOrigin&quot;: &quot;&quot;,
          &quot;allowMethods&quot;: &quot;&quot;,
          &quot;allowHeaders&quot;: &quot;&quot;
      }
  }
  </code></pre>
  <h3>UPDATE</h3>
  <p>Now I have tried:</p>
  <pre><code>command=/home/ec2-user/.nvm/versions/node/v13.5.0/bin/laravel-echo-server start --dir=/var/www/html
  </code></pre>
  <p>per the suggestion in the post comments. However that is returning <code>ERROR (spawn error)</code></p>
  <p>When I check the supervisord.log, it shows the following:</p>
  <pre><code>2019-12-31 07:27:05,869 INFO exited: laravel-echo-server_00 (exit status 127; not expected)
  </code></pre>
  <p>Exit status code 127 apparently means &quot;command not found&quot;.</p>