简体   繁体   中英

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 -v
@pause

I have a similar file nodejs_version.cmd that does pause and keeps the window open:

node -v
@pause

It seems npm is changing the window to npm and then back to cmd or something.

Any idea how to force this to pause?

bceause npm itself is a bat (or cmd) file.

try with :

call npm -v

you are hitting this case

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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