Not able to install another erlang version for local directory

I have installed elixir and erlang using asdf and I have set the global version as otp 23 and elixir latest. But one for one of my project I need to install otp 22 but It somehow not able to install and I’m getting this error. I need to install this locally

asdf_22.1.7 is not a kerl-managed Erlang/OTP installation
The asdf_22.1.7 build has been deleted
Extracting source code
Building Erlang/OTP 22.1.7 (asdf_22.1.7), please wait...
Build failed.
                             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/netinet6/in6.h:212:30: note: previous declaration is here
extern const struct in6_addr in6addr_loopback;
                             ^
2 errors generated.
make[4]: *** [obj/x86_64-apple-darwin19.6.0/opt/smp/socket_nif.o] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

Please see /Users/siddhant/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.7/otp_build_22.1.7.log for full details.

any suggestion?

It’s in the build file here

▶ /Users/siddhant/.asdf/plugins/erlang/kerl-home/builds                                 

erlang/kerl-home/builds  master ✔                                                                                                                                                                    62d17h  
▶ ls
asdf_22.0  asdf_22.0.1  asdf_22.1.7  asdf_22.1.8  asdf_23.0.1

erlang/kerl-home/builds  master ✔                                                                                                                                                                    62d17h  
▶ /Users/siddhant/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.7

kerl-home/builds/asdf_22.1.7  master ✔                                                                                                                                                               62d17h  
▶ ls
otp_build_22.1.7.log  otp_src_22.1.7

kerl-home/builds/asdf_22.1.7  master ✔                                                                                                                                                               62d17h  
▶ /Users/siddhant/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.7/otp_build_22.1.7.log 
zsh: permission denied: /Users/siddhant/.asdf/plugins/erlang/kerl-home/builds/asdf_22.1.7/otp_build_22.1.7.log