3

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?

Craig
  • 2,093
  • 3
  • 28
  • 43
  • 3
    I assume `npm` is a batch file, sou you need to state `call npm` for the execution to return to your calling batch file... – aschipfl Sep 16 '16 at 09:21

1 Answers1

4

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

try with :

call npm -v

you are hitting this case

Community
  • 1
  • 1
npocmaka
  • 55,367
  • 18
  • 148
  • 187