防止“中止"在Windows批处理中进行npm安装 [英] prevent "abort" in windows batch for npm install

查看:81
本文介绍了防止“中止"在Windows批处理中进行npm安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个bat文件,以自动安装npm软件包并安装指南针.蝙蝠很简单,如下所示:

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

我发现在每个命令之后,bat文件都会自动中止并且不会运行下一个命令.如何使这个简单的脚本连续运行并能够多次运行?

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?

推荐答案

npm程序本身可能是一个批处理文件.
然后,您需要使用call,因为只有这样,程序控件才会返回到调用方.

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

这篇关于防止“中止"在Windows批处理中进行npm安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆