It doesn't matter if Npm is ever profitable. If an investor puts money into Npm, they are indirectly adding value to every company that uses Npm. Making sure that a comprehensive dependency manager exists for JavaScript helps every company that uses JavaScript.
Additionally, neither JavaScript or Ruby is nearing their "swan song". Other languages will come out. The current languages will persist.