air icon indicating copy to clipboard operation
air copied to clipboard

使用air报错

Open Sunrisies opened this issue 1 year ago • 3 comments


/ /\ | | | |) //--\ || || _ v1.61.0, built with Go go1.23.2

watching . !exclude tmp building... failed to build, error: exec: "cmd": executable file not found in %PATH% running... panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0xa0 pc=0x10bd128]

goroutine 12 [running]: github.com/air-verse/air/runner.(*Engine).runBin.func2() C:/Users/Lenovo/go/pkg/mod/github.com/air-verse/[email protected]/runner/engine.go:543 +0x228 created by github.com/air-verse/air/runner.(*Engine).runBin in goroutine 11 C:/Users/Lenovo/go/pkg/mod/github.com/air-verse/[email protected]/runner/engine.go:522 +0xc5 image

Sunrisies avatar Oct 10 '24 03:10 Sunrisies

please paste the air config

cosmtrek avatar Oct 10 '24 14:10 cosmtrek

我在当前目录下面没有生成默认的.air.toml文件,直接运行的,但是不管有没有这个配置文件都是报这个错误

Sunrisies avatar Oct 11 '24 08:10 Sunrisies

failed to build, error: exec: "cmd": executable file not found in %PATH%

你把cmd.exe添加到 环境变量里面后,再试试看

xingdongzhe avatar Jun 16 '25 14:06 xingdongzhe