Unexpected token on install step

OS: Linux Mint 21.3 Cinnamon
Behavior: Fails to install.
Reproduce: Install step on Linux.

Note: NodeJS and NVM are both properly installed.

Log:

user@computer:location.to/node_modules/create-narrat/index.js:214
  return targetDir?.trim().replace(/\/+$/g, '');
                   ^

SyntaxError: Unexpected token '.'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code 1
npm ERR! path /.../Narrat Projects
npm ERR! command failed
npm ERR! command sh -c create-narrat

I assume this is due to the outdated node.js version on debian? Support for optional chaining syntax is somewhat recent in node so that would track.

I installed the latest version, though I should have probably removed the outdated version first. I’ll try that. Thanks for your reply and cute Anya avatar!

1 Like