Macos M1 Ventura 13.0.1 Elastic agent install fail

I installed the elastic agent on macos Ventura 13.0.1 using the command line and the installation failed showing:

panic: getwd: invalid argument

goroutine 1 [running]: +0x148 +0x20 +0x20

Command used:
sudo . /elastic-agent install --url=https://xx.xx --enrollment-token=xx --insecure --force

What is the solution to this?

which version of elastic-agent are you trying to install?

Also, just to double check. Are you using the aarch64 version or the x86_64 version?

Also does the Terminal application that you are installing from have Full Disk Access? We have seen the install fail on Ventura when it doesn't.