Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prevent "abort" in windows batch for npm install

Tags:

npm

batch-file

I am writing a bat file to auto install npm packages and install compass. The bat is simple as below:

npm install -g bower npm install -g grunt-cli npm install gem update --system --verbose gem install compass --verbose pause 

I find that after each command, the bat file auto aborts and won't run next command. How can I make this simple script run continuously and able to re-run many times?

like image 965
Chris Li Avatar asked Oct 09 '13 06:10

Chris Li


People also ask

How do I stop a batch file from closing automatically?

Add a pause statement to a batch file If you're creating a batch file and want the MS-DOS window to remain open, add PAUSE to the end of your batch file. This prompts the user to Press any key. Until the user presses any key, the window remains open instead of closing automatically.

Is there an npm stop?

To stop a running npm process, press CTRL + C or close the shell window.


1 Answers

Possibly the npm program is a batch file itself.
Then you need to use call, as only then the program control returns to the caller.

call npm install -g bower call npm install -g grunt-cli call npm install call gem update --system --verbose call gem install compass --verbose pause 
like image 57
jeb Avatar answered Sep 18 '22 23:09

jeb