try console.log() it will log on the console. alert doesnot displays the object.
$.ajax({
url: 'http://localhost:8081/all-modules',
dataType: 'application/json',
complete: function(data){
console.log(data)
},
success: function(data){
console.log(data)
}