Nerixyz / instagram_mqtt

Realtime and Push Notification (FBNS) support for the instagram-private-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Object.fromEntries is not a function

noirtier-villefort opened this issue · comments

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?

commented

Your version of nodejs is outdated.