Open HulioEglesias opened 4 years ago
Use console.log(client) and make sure the username and password are filled in the Instagram object in parameter 'credentials'.
Are you still dealing with this issue ?
I have the same issue, here's my code:
require('dotenv').config()
const Instagram = require('instagram-web-api')
const { username, password } = process.env
const client = new Instagram({ username, password })
console.log(client)
client
.login()
.then(() => {
client
.getProfile()
.then(console.log)
})
and the output :
➜ folder $ npm start
> instagram-bot@1.0.0 start
> node index.js
Instagram {
credentials: { username: 'myusername', password: 'mypassword' },
request: [Function (anonymous)] {
get: [Function (anonymous)],
head: [Function (anonymous)],
post: [Function (anonymous)],
put: [Function (anonymous)],
patch: [Function (anonymous)],
del: [Function (anonymous)],
delete: [Function (anonymous)],
cookie: [Function (anonymous)],
jar: [Function (anonymous)],
defaults: [Function (anonymous)]
}
}
undefined
any ideas why ?
I used an example code and got undefined. code: