Search code examples
node.jsnpmyarnpkg

Unexpected token '.' from poppinss, after running node ace migration:run


I'm trying to run node ace migration:run, but it won't execute due to this error.

I've tried reinstalling packages with yarn and npm, as well as rebooting computer.

I don't have a single clue on how to fix it or how to Google for a solution.

enter image description here


Solution

  • You're getting a syntax error, and it points at ?. (the optional chaining operator).

    You're using a version of Node.js that doesn't support the ?. operator (versions older than Node 14).

    Upgrade your Node.js to 14.0 or newer.