Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in simple login #80

Open
kimia000 opened this issue Apr 8, 2019 · 6 comments
Open

Problem in simple login #80

kimia000 opened this issue Apr 8, 2019 · 6 comments

Comments

@kimia000
Copy link

kimia000 commented Apr 8, 2019

I try to simply log in as

const Instagram = require('instagram-web-api');
const client = new Instagram({ username: 'XX', password: 'YY' });

(async () => {
   await client.login();
   const profile = await client.getProfile();
})();

but it returns the error:

TypeError: Cannot read property 'map' of undefined
    at request.then.res (/home/kimia/node_modules/instagram-web-api/lib/index.js:55:46)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
@franzsilva
Copy link

I would place the code inside a try catch. so you can catch any errors returned.

const Instagram = require('instagram-web-api');
const client = new Instagram({ username: 'XX', password: 'YY' });

(async () => {
    try {
        await client.login();
        const profile = await client.getProfile();
        console.log("Profile:", profile);
    } catch (error) {
        console.log("Error:", error);
    }

})();

@TheRTK
Copy link

TheRTK commented May 5, 2019

I have same problem!

Instagram does not send header "set-cookie".

instagram-web-api/lib/index.js:55:46
.then(res => res.headers['set-cookie'].map(Cookie.parse))

@Aljal
Copy link

Aljal commented May 23, 2019

Same problem here can someone help us pls ?

@gutosanches
Copy link

Looks like the package is outdated in npm. I fixed that by installing the package using the master branch putting this in my package.json:
"instagram-web-api": "https://github.com/jlobos/instagram-web-api.git"

@MonsieurBibo
Copy link

Is it still relevant ? If not can you close this issue please ?

@ruskid
Copy link

ruskid commented Apr 2, 2022

still relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants