1

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.

2
  • 2
    Is npm a Batch file: npm.bat? If so, you need to execute it via call command: call npm install. The same point apply to bower Commented Mar 13, 2014 at 21:28
  • Ok. So your suggestion worked. If you want to put that as the answer, I'll mark it as correct. Commented Mar 13, 2014 at 21:44

1 Answer 1

6

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.

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.