0

I am writing a batch file to install packages and run server for multiple Node.js applications. My current script start the first server and then do nothing.

I think it is due to node server command. It's change the command line to node console and then can't run the other commands. So I need to get back to the command line from the node console.

I need to install packages and run the first server and then install packages and run the second server and then another server.

My current script:

@echo off
title App Installer
echo Starting Deployment: %date% %time%
pushd app-svc
echo Installing Service...
call npm install
node server
popd
pushd app-view
echo Installing UI...
call npm install
popd
pushd app-view/public
echo Installing Public UI...
call npm install
popd
node server
popd
pushd app-admin
echo Installing App Admin...
call npm install
echo Building App Admin...
call npm run client:build
echo Running App Admin...
call npm run serve:dev

Also I need to close the command prompt after all these commands without stopping the server.

How could I achieve this?

Bishan
  • 15,211
  • 52
  • 164
  • 258

0 Answers0