I need to compile the latex to pdf on heroku node.js server. The problem is that we need to install texlive for exec command.
Since Heroku is running Debian/Ubuntu Linux, yes. You might be looking for a lean installation, see here.