pages build error

pages deployment failing, what could be wrong?
Executing user command: next build && next export
03:38:26.456 /opt/buildhome/repo/node_modules/next/dist/build/index.js:440
03:38:26.457 ...pageKeys.app ?? []
03:38:26.457 ^
03:38:26.457
03:38:26.458 SyntaxError: Unexpected token '?'
03:38:26.458 at wrapSafe (internal/modules/cjs/loader.js:1054:16)
03:38:26.458 at Module._compile (internal/modules/cjs/loader.js:1102:27)
03:38:26.458 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
03:38:26.458 at Module.load (internal/modules/cjs/loader.js:986:32)
03:38:26.458 at Function.Module._load (internal/modules/cjs/loader.js:879:14)
03:38:26.458 at Module.require (internal/modules/cjs/loader.js:1026:19)
03:38:26.458 at require (internal/modules/cjs/helpers.js:72:18)
03:38:26.458 at Object.<anonymous> (/opt/buildhome/repo/node_modules/next/dist/cli/next-build.js:15:55)
03:38:26.459 at Module._compile (internal/modules/cjs/loader.js:1138:30)
03:38:26.459 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
03:38:26.465 Failed: build command exited with code: 1
03:38:27.532 Failed: error occurred while running build command
Executing user command: next build && next export
03:38:26.456 /opt/buildhome/repo/node_modules/next/dist/build/index.js:440
03:38:26.457 ...pageKeys.app ?? []
03:38:26.457 ^
03:38:26.457
03:38:26.458 SyntaxError: Unexpected token '?'
03:38:26.458 at wrapSafe (internal/modules/cjs/loader.js:1054:16)
03:38:26.458 at Module._compile (internal/modules/cjs/loader.js:1102:27)
03:38:26.458 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
03:38:26.458 at Module.load (internal/modules/cjs/loader.js:986:32)
03:38:26.458 at Function.Module._load (internal/modules/cjs/loader.js:879:14)
03:38:26.458 at Module.require (internal/modules/cjs/loader.js:1026:19)
03:38:26.458 at require (internal/modules/cjs/helpers.js:72:18)
03:38:26.458 at Object.<anonymous> (/opt/buildhome/repo/node_modules/next/dist/cli/next-build.js:15:55)
03:38:26.459 at Module._compile (internal/modules/cjs/loader.js:1138:30)
03:38:26.459 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
03:38:26.465 Failed: build command exited with code: 1
03:38:27.532 Failed: error occurred while running build command
2 Replies
Walshy
Walshy17mo ago
looks like your Node.js version is low Change to build system v2 or add env var NODE_VERSION with a value like 18
sumit
sumitOP17mo ago
thanks for super fast support walshy, i fixed it by using node 19 (my system node) what's this build system v2 though? how do i use it?
Want results from more Discord servers?
Add your server