You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

配置Supervisor启动Laravel-Echo-Server时遇node找不到错误

解决Supervisor启动Laravel-Echo-Server时的"node: No such file or directory"错误

从你给出的日志和配置来看,问题的核心是Supervisor运行进程时的环境变量里找不到node的路径——虽然你在command里指定了laravel-echo-server的绝对路径,但这个工具的启动脚本开头大概率是#!/usr/bin/env node,它会尝试从当前环境的PATH里找node,而Supervisor默认的PATH并不包含你通过nvm安装的node目录。

下面给你两个可行的解决办法:

方法一:直接用node的绝对路径启动laravel-echo-server

修改你的laravel-echo.conf里的command配置,明确指定node的绝对路径来运行laravel-echo-server:

[program:echo-server]
directory=/var/www/html/nowme_realchat
command= /home/nayan/.nvm/versions/node/v10.15.1/bin/node /home/nayan/.nvm/versions/node/v10.15.1/bin/laravel-echo-server start
autostart=true
autorestart=true
startsecs=0
user=root
redirect_stderr=true
stdout_logfile=/var/www/html/nowme_realchat/storage/logs/echoserver.log

方法二:给Supervisor进程添加包含node的PATH环境变量

在laravel-echo.conf里新增environment配置项,把node所在的目录加入到PATH中:

[program:echo-server]
directory=/var/www/html/nowme_realchat
command= /home/nayan/.nvm/versions/node/v10.15.1/bin/laravel-echo-server start
autostart=true
autorestart=true
startsecs=0
user=root
redirect_stderr=true
stdout_logfile=/var/www/html/nowme_realchat/storage/logs/echoserver.log
environment=PATH="/home/nayan/.nvm/versions/node/v10.15.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"

配置修改后的操作

不管用哪种方法,修改完配置后都需要执行以下命令让Supervisor加载新配置:

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start echo-server

之后再用sudo supervisorctl status查看状态,应该就能正常启动了。

内容的提问来源于stack exchange,提问作者nayan verma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:44:21