Nerixyz / instagram_mqtt

Realtime and Push Notification (FBNS) support for the instagram-private-api
MIT License
244 stars 49 forks source link

TypeError: Object.fromEntries is not a function #68

Closed noirtier-villefort closed 3 years ago

noirtier-villefort commented 3 years ago

Hello. I'm trying to run the code from the example:

import { IgApiClient } from 'instagram-private-api';
import { withFbnsAndRealtime, withFbns, withRealtime } from 'instagram_mqtt';

// wrap the client
// ig is now IgApiClientMQTT for typescript users
const ig = withFbnsAndRealtime(new IgApiClient());
console.log("init ");

But I get a mistake:

.../node_modules/mqtts/dist/mqtt.constants.js:21
const reverseMapping = Object.fromEntries(Object.entries(PacketType).map(([k, v]) => [v, k]));
                              ^

TypeError: Object.fromEntries is not a function

What to do and how to fix?

Nerixyz commented 3 years ago

Your version of nodejs is outdated.