简体   繁体   中英

Installing multiple node modules with batch file

I am trying to write a batch file that will install node modules from, and in, different directories. My problem is that the script is navigating to the foo directory and executing npm install but then it won't execute the other two do() commands.

do(
    cd foo
    npm install
)

do(
    cd ../bar
    npm install
)

do(
    cd ../again
    bower install
)

EDIT:

I've also tried the following in a .bat file

call Install_Node_Components_Site.bat

call Install_Bower_Components.bat

call Install_Node_Components_Test.bat

The Install_Node_Components_Site.bat file is very basic and looks like this.

cd foo
npm install

The foo directory has the packages.json file so my thinking is that I can just call npm install like I normally would from the command line.

If npm is a Batch file: npm.bat , it requires to be executed via call command this way:

do(
    cd foo
    call npm install
)

The same point apply for bower command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM