gpt4 book ai didi

Vercel Go Runtime can't access the binary file(Vercel Go运行时无法访问二进制文件)

转载 作者:bug小助手 更新时间:2023-10-25 19:43:47 31 4
gpt4 key购买 nike



I created a REST API with Go and deployed it to vercel with github.com/tbxark/g4vercel.

我使用Go创建了一个rest API,并使用githeb.com/tbxark/g4vercel将其部署到Vercel。


This is my project structure:

这是我的项目结构:


- api > index.go
- go.mod
- go.sum
- vercel.json
- X (this is the CLI tool binary written in Golang)

Now, within the index.go file, I have this code:

现在,在index.go文件中,我有以下代码:


cliPath := "./X"
helpCmd := exec.Command(cliPath, "--help")

But vercel cannot find this binary when executing the command above. It shows this error:

但Vercel在执行上述命令时找不到此二进制文件。它显示以下错误:


fork/exec ./X: no such file or directory 

How to solve this issue? Thanks.

如何解决这个问题?谢谢。


更多回答
优秀答案推荐
更多回答

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com