1

I'm learning Next.JS by following the freecodecamp tutorial, and running npm run dev gives the following error output:

showAll: args["--show-all"] ?? false,
                             ^

SyntaxError: Unexpected token ?
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)

I'm running npm version 8.19.2 and node version 18.12.1, which should support null coalescing.

Grateful for any ideas.

I tried updating my node and npm versions, and ensuring they support null coalescing. According to some previous answers on here that aught to have done it.

2
  • are you using typescript, stackoverflow.com/questions/62426269/… Commented Apr 7, 2023 at 0:31
  • @windmaomao yes, create-next-app sets up a typescript application Commented Apr 10, 2023 at 13:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.