Search code examples
node.jscommand-linecmd

What's the difference between the "Node.js command prompt" and the Windows command prompt?


What's the difference between the "Node.js command prompt" and the Windows command prompt?

Or, more to the point, why does it even exist when you can run node programs from the Windows command prompt?

Note: I'm asking about this guy, not the REPL:

Windows Node.js command prompt


Solution

  • Read the property of the shortcut. It simply executes cmd.exe with an argument that executes a .bat file and then returns to the prompt.

    C:\Windows\System32\cmd.exe /k "C:\Program Files\nodejs\nodevars.bat"
    

    All it really does is ensure that the path is setup properly for using node and npm. I've never needed to use this because my path is setup to include these paths already (yours likely is too.)