“Node.js命令提示符”和Windows命令提示符之间有什么区别?

时间:2021-11-23 00:14:12

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

“Node.js命令提示符”和Windows命令提示符之间有什么区别?

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

或者,更重要的是,当您可以从Windows命令提示符运行节点程序时,为什么它甚至存在?

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

注意:我问的是这个人,而不是REPL:

“Node.js命令提示符”和Windows命令提示符之间有什么区别?

1 个解决方案

#1


9  

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.

阅读快捷方式的属性。它只是执行带有执行.bat文件的参数的cmd.exe,然后返回到提示符。

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.)

它真正做的就是确保使用node和npm正确设置路径。我从来不需要使用它,因为我的路径已经设置为包含这些路径(你可能也是这样)。

#1


9  

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.

阅读快捷方式的属性。它只是执行带有执行.bat文件的参数的cmd.exe,然后返回到提示符。

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.)

它真正做的就是确保使用node和npm正确设置路径。我从来不需要使用它,因为我的路径已经设置为包含这些路径(你可能也是这样)。