contentful space export command failing due to an unexpected token in one of the node modules [ @hapi/hoek/lib/contain.js ]
So we have a pipeline configured to take regular weekly backups of our content housed within a specific SpaceID. It came to our attention that , for last few weeks our pipelines were failing.
Following is the the command that we run
contentful space export --space-id $Contentful_Space_Id --environment-id master --management-Token $Contentful_CMA_Token --exportDir contentful_content-backup
Here is the error that we are getting
/usr/local/lib/node_modules/contentful-cli/node_modules/contentful-migration/node_modules/@hapi/hoek/lib/contain.js:82 compare = compare ?? internals.compare(options); ^ SyntaxError: Unexpected token ? at new Script (vm.js:80:7) at createScript (vm.js:274:10) at Object.runInThisContext (vm.js:326:10) at Module._compile (internal/modules/cjs/loader.js:664:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (/usr/local/lib/node_modules/contentful-cli/node_modules/contentful-migration/node_modules/@hapi/hoek/lib/index.js:13:19) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3)
Node version : node:10.15.3
Hi @TitusRobyK What version of the CLI are you using? Also, the node version you are using is not supported anymore. Would it be possible for you to update to at least the latest LTS?
I stumble on this one and it was solved by installing the latest node version.