Next.js Discord

Discord Forum

Error when trying to run `npm run dev`

Answered
Ceddix posted this in #help-forum
Open in Discord
> next dev

C:\xampp\htdocs\carpet\node_modules\next\dist\lib\picocolors.js:134
const { env, stdout } = ((_globalThis = globalThis) == null ? void 0 : _globalThis.process) ?? {};
                                                                                             ^

SyntaxError: Unexpected token ?
    at Module._compile (internal/modules/cjs/loader.js:749:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
    at Module.load (internal/modules/cjs/loader.js:672:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
    at Function.Module._load (internal/modules/cjs/loader.js:604:3)
    at Module.require (internal/modules/cjs/loader.js:711:19)
    at Module.mod.require (C:\xampp\htdocs\carpet\node_modules\next\dist\server\require-hook.js:64:28)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (C:\xampp\htdocs\carpet\node_modules\next\dist\build\output\log.js:55:21)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! carpet@0.1.0 dev: `next dev`
npm ERR! Exit status 1
Answered by Rafael Almeida
What is your node.js version? Next requires at least v18.17
View full answer

11 Replies

What is your node.js version? Next requires at least v18.17
Answer
ohhh
okay so I actually updated nodejs
but it seems like it didn't work
the thing is if I open my cmd as administrator, it says that I'm on version v20.9.0 but if I got to the normal cmd or inside IntelliJ it still seems to be v11.13.0
Try rebooting the PC
I already did that
If that doesn't work you will likely need to check the settings on the IDE, it might be using a different install path
It think it's not related do the IDE but rather something with windows >.>
Oh I found the error
Thanks for your help tho!