NodeJS - Get json with node-fetch

Like I said I don’t use node-fetch and I didn’t test this for you, you should be able to basic debug this!

Change

.then(res => {
    var token = resp.body.access_token

to

.then(res => {
    console.log(res);

and see what it returns for yourself.

I imagine it should be in fact

    var token = res.access_token;