使用air报错
/ /\ | | | |) //--\ || || _ 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
please paste the air config
我在当前目录下面没有生成默认的.air.toml文件,直接运行的,但是不管有没有这个配置文件都是报这个错误
failed to build, error: exec: "cmd": executable file not found in %PATH%
你把cmd.exe添加到 环境变量里面后,再试试看