Next.js Discord

Discord Forum

SyntaxError: Unexpected token '?'

Unanswered
Argentine hake posted this in #help-forum
Open in Discord
Argentine hakeOP
root@srv602549:~/Cosmo-Website# npm run build

cosmo-website@0.1.0 build
next build

/root/Cosmo-Website/node_modules/next/dist/lib/picocolors.js:134
const { env, stdout } = ((_globalThis = globalThis) == null ? void 0 : _globalThis.process) ?? {};
^

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 Module.mod.require (/root/Cosmo-Website/node_modules/next/dist/server/require-hook.js:65:28)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/root/Cosmo-Website/node_modules/next/dist/build/output/log.js:55:21)
at Module._compile (internal/modules/cjs/loader.js:999:30)

2 Replies

Argentine hakeOP
Why i'm still getting this error?
Toyger
update your nodejs version, at least to v18 lts