getting the following error while trying to install caret package

Warning in install.packages :
installation of package ‘recipes’ had non-zero exit status

The "non-zero exit status" simply means there was an error. Please post the entire output from the install.packages function and someone will probably be able to provide specific guidance on fixing the problem.

Installing package into ‘/Users/asrivas3/Library/R/4.0/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘recipes’


  There is a binary version available but the source
  version is later:
        binary source needs_compilation
recipes 0.1.13 0.1.14             FALSE

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/caret_6.0-86.tgz'
Content type 'application/x-gzip' length 6248430 bytes (6.0 MB)
==================================================
downloaded 6.0 MB


The downloaded binary packages are in
	/var/folders/fk/7gpj1m4s2w37y41nz5lktx79t8xyt4/T//Rtmp6M0WJ0/downloaded_packages
installing the source package ‘recipes’

trying URL 'https://cran.rstudio.com/src/contrib/recipes_0.1.14.tar.gz'
Content type 'application/x-gzip' length 645706 bytes (630 KB)
==================================================
downloaded 630 KB

Warning in file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
dyld: lazy symbol binding failed: Symbol not found: _utimensat
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _utimensat
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 63384 Done                    echo 'tools:::.install_packages()'
     63385 Abort trap: 6           | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --no-echo --args ${args}
Warning in install.packages :
  installation of package ‘recipes’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/fk/7gpj1m4s2w37y41nz5lktx79t8xyt4/T/Rtmp6M0WJ0/downloaded_packages’

It seems you tried to compile from source rather than accept the binary.
So one option for you is to run the same code again, but accept the binary.
If you need to compile from source on macosx you will need Xcode, what version of Xcode do you have ?

version 1.0.6 21jun2019

I dont think that can be right.
Perhaps try getting version 12 anyway