prevent “abort” in windows batch for npm install

2019-03-23 07:31发布

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?

1条回答
放我归山
2楼-- · 2019-03-23 07:39

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
查看更多
登录 后发表回答