3

Can someone help me with this error

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.dev (/Users/@#@!1/!@#@!/node_modules/next/dist/lib/commands.js:10:30)
    at Object.<anonymous> (/Users/!@#!/!@#!!#/node_modules/next/dist/bin/next:141:28)
    at Module._compile (internal/modules/cjs/loader.js:999:30)

I ran npm on a mac

Hooy
  • 31
  • 1
  • 2

3 Answers3

7

This happens, perhaps, due to incompatibility between Next.js and Node.js versions. If you upgrade your Node.js version to at least v14, it will work.

Asaye
  • 131
  • 1
  • 3
1

I had the same problem! and I took Asaye's advice to update Node.js, and it worked.

0

I had the same issue when I try to run my next.js application. When I update the node version, error was gone.

You can use nvm(node version manager) to use multiple node versions in your computer.

Hope this will help to sort out your issue.