Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Cannot find module '../dist/cli' - supervisord #592

Open
bertalanimre opened this issue Apr 28, 2022 · 0 comments
Open

Cannot find module '../dist/cli' - supervisord #592

bertalanimre opened this issue Apr 28, 2022 · 0 comments

Comments

@bertalanimre
Copy link

Running laravel-echo-server inside supervisor results in the following error message

Error: Cannot find module '../dist/cli'
Require stack:
- /usr/bin/laravel-echo-server
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/bin/laravel-echo-server:10:28)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/bin/laravel-echo-server' ]
}

To Reproduce
Steps to reproduce the behavior:

  1. Installed Node 12.18.3 via NVM
  2. Installed laravel-echo-server globally
  3. Created laravel-echo-server.json inside project folder
  4. Created supervisord ini file as follows:
[program:echoserver]
command=laravel-echo-server start --dir=/var/www/html/myproject/staging/configs
directory=/var/www/html/mypropject/staging/configs
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=web
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/html/myproject/staging/shared/storage/logs/supervisor/echoserver.log
logfile_maxbytes=50MB
logfile_backups=31
  1. Started echo inside supervisorctl
  2. See log message

Additional context
The module is present, but on a completely different place. It is:
/home/web/.nvm/versions/node/v12.18.3/lib/node_modules/laravel-echo-server/dist/cli

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant