Contentful logo

Contentful Community

Contentful-migration failing to authorize

I am trying to get a sample running using the contentful-migration tool. My index.js looks like the following:

“use strict”;

const contentful = require(‘contentful-migration/built/bin/cli’).default;

this.options = Object.assign({
spaceId: ‘2XXXX0’,
accessToken: ‘afXXXXXXXXXXXXXXXXXc1’,
environmentId: ‘dev’,
filePath: ‘angry-dog.js’,
yes: true
}, []);

console.log(“running file %s”, this.options.filePath);
console.log(“spaceId (%s), accessToken(%s)”, this.options.spaceId, this.options.accessToken);
contentful(this.options).then(() => console.log(“successfuly created content types.”))

when I run the app I get the following:
The provided space does not exist or you do not have access.

I am able to successfully make SDK calls with the spaceId and accessToken so I am pretty sure they are valid.

Any help is appreciated