...
$ module load impi/2018.5
$ module load julia
$ julia -e 'using Pkg; Pkg.add("MPIPreferences")'
$; juliausing -e 'using PkgMPIPreferences; MPIPreferences.use_system_binary(); Pkg.add("MPI")'
You can test the the correct version is used via
$ julia -e 'using MPI; println(MPI.MPI_LIBRARY_VERSION_STRING)'
...
There is no direct dependency to impi/2018.5 in Julia's module file, so if needed it is still possible to adjust the environment to a different configuration before building and loading the MPI module.jl package. Please check to the MPI.jl documentation for details.
...