DEV Community

Discussion on: 5 Steps to debugging Next.js/Node.js from VSCode or Chrome DevTools

Collapse
 
eunjae_lee profile image
Eunjae Lee

Hey, embarrassingly, I do not remember which command I was using yesterday. (It was literally yesterday, though)

anyway you're saying

NODE_OPTIONS='--inspect' next
node --inspect node_modules/.bin/next

These two commands are equivalent?
I didn't know. Thank you!

Thread Thread
 
vvo profile image
Vincent Voyer

I do not know if both of those commands are equivalent, what I know is that:

{
  "scripts": {
    "dev": "next"
  }

and

{
  "scripts": {
    "dev": "./node_nodules/.bin/next"
  }

are equivalent, because of: docs.npmjs.com/misc/scripts#path

What I wanted to say is that:

running

NODE_OPTIONS='--inspect' yarn dev

will fail because this starts two processes in debugger mode: yarn and nextjs. This is why you get the error message about already running debugging server.

NODE_OPTIONS can only be passed right next to the next command inside package.json.