Change the MQTT node to deliver a buffer.
There is no need to make a tgz, adding it to the function node is all you need to do.
Ps. Uploading TGZ modules is for Node-RED node packages - I.e. node-red-contrib-xyz. This module is simply a library - not a full on Node-RED node package - so that won't work here