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?

1
  • 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... Commented Sep 16, 2016 at 9:21

1 Answer 1

6

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

try with :

call npm -v

you are hitting this case

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.