简体   繁体   English

为什么检查npm版本时命令提示符脚本关闭?

[英]Why does command prompt script close when checking npm version?

I have a file npm_version.cmd that does not pause and instead closes the window: 我有一个npm_version.cmd文件,该文件不会暂停,而是关闭窗口:

npm -v
@pause

I have a similar file nodejs_version.cmd that does pause and keeps the window open: 我有一个类似的文件nodejs_version.cmd ,它会暂停并保持窗口打开:

node -v
@pause

It seems npm is changing the window to npm and then back to cmd or something. 看来npm会将窗口更改为npm,然后又更改为cmd或其他内容。

Any idea how to force this to pause? 知道如何强制暂停吗?

bceause npm itself is a bat (or cmd) file. bceause npm本身是一个bat(或cmd)文件。

try with : 尝试:

call npm -v

you are hitting this case 你在打这案子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM