使用Bun运行Inngest开发服务器时inngest-cli命令未被识别的问题求助
使用Bun运行Inngest开发服务器时inngest-cli命令未被识别的问题求助
我正在按照Inngest官方文档,在基于Bun运行时的Next.js App Router项目中配置Inngest。我完全遵循了文档里的安装步骤,但启动Inngest开发服务器时却一直失败,遇到了命令未被识别的错误。
具体错误情况
我先执行了文档里要求的全局安装命令:
bun add inngest bun add global inngest-cli@latest
之后尝试启动开发服务器:
inngest-cli dev
结果直接弹出以下错误:
inngest-cli : The term 'inngest-cli' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + inngest-cli dev + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (inngest-cli:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
最开始我还试过直接运行inngest-cli@latest dev,同样得到了“该术语未被识别”的错误。
预期行为
根据官方文档,运行开发服务器应该能正常工作(类似用npx inngest-cli@latest dev的效果),并输出类似这样的日志:
12:33PM INF executor > service starting 12:33PM INF runner > starting event stream backend=redis 12:33PM INF executor > subscribing to function queue 12:33PM INF runner > service starting 12:33PM INF runner > subscribing to events topic=events 12:33PM INF no shard finder; skipping shard claiming 12:33PM INF devserver > service starting 12:33PM INF devserver > autodiscovering locally hosted SDKs 12:33PM INF api > starting server addr=0.0.0.0:8288 Inngest dev server online at 0.0.0.0:8288, visible at the following URLs: - http://127.0.0.1:8288 (http://localhost:8288)
我尝试过的解决方法
- 删除了
node_modules文件夹,然后重新执行bun install --force - 尝试用
bunx来运行命令:
但都失败了,报错:bunx inngest-cli dev bunx inngest deverror: could not create process Bun failed to remap this bin to its proper location within node_modules. - 确认Bun本身是正常安装的,
bun --version能正常输出版本号
我的疑问
为什么用Bun全局安装inngest-cli之后,系统还是识别不到这个命令呢?我是不是需要手动把Bun的全局bin路径添加到Windows的PATH环境变量里?或者用Bun运行Inngest开发服务器有什么其他推荐的方法吗?
内容来源于stack exchange
相关产品推荐
相关产品推荐

