ryanmurakami/pizza-luvrs

Syntax error

Closed this issue · 5 comments

npm version 6.10.0

console.error(Reason: ${reason.message}, Stack: ${reason?.stack}) ^

SyntaxError: Unexpected token .
at Module._compile (internal/modules/cjs/loader.js:720:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:840:10)
at internal/main/run_main_module.js:17:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pizza-luvrs@2.0.0 start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pizza-luvrs@2.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Hi also facing same problem npm 6.13.4 @madizii has you come across a solution? Would appreciate it, thank you

What version of Node.js are you using? It looks like it's failing on optional chaining, which was introduced in v14: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining

Hi @ryanmurakami I am using node version 12.15.0

Thanks @darragh1991! That's the issue. To do optional chaining the Node.js version should be at least 14. If you remove the '?' in that line, it should still work and then you can continue using v12, but I can't guarantee other parts of the code won't have issues. If you're able to upgrade, just go all the way to v16.

Thank you, you saved my weekend, yes its came to this...