Next.js Discord

Discord Forum

error running 'npm run dev'

Unanswered
Madeiran sardinella posted this in #help-forum
Open in Discord
Madeiran sardinellaOP
So I was searching for my error online and I came across the same exact error but the solution wasn't posted. Wondering how I can fix this? (Here is the OP that I came across as well -> https://nextjs-forum.com/post/1172249711084830771#message-1172251299056734279)

Also I verified node version (20.10.0), npm version (10.2.4). I've restarted and even deleted my node modules from the project. Another person was able to run it just fine and had the same exact version + packages.

> next dev

C:\Users\Amy\Desktop\test\fireside-chat\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:1053:16)
    at Module._compile (internal/modules/cjs/loader.js:1101:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at Module.mod.require (C:\Users\Amy\Desktop\test\fireside-chat\node_modules\next\dist\server\require-hook.js:64:28)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\Amy\Desktop\test\fireside-chat\node_modules\next\dist\build\output\log.js:55:21)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)

5 Replies

what is your next version?
node version (>=20) is used in nextjs latest version like(>=14)
try running npx next info to see what versions of things nextjs is using
@Madeiran sardinella can you show the debug info using command or has this been solved?
Madeiran sardinellaOP
not solved, but i won’t be able to access the computer for the weekend. i’ll try to update when i can