A
A
Alexey Yarkov2016-04-20 13:52:41
cmd/bat
Alexey Yarkov, 2016-04-20 13:52:41

How to run npm from bat file?

Development is on Windows. At work, when I have time, I use c9.io. I came home, did a git pull and I'm working.
There is a sequence of commands to get started, namely:

$ npm install
$ bower install
$ gulp build
$ gulp watch
$ npm start

Tired of waiting for execution and entering pens. I want to automate using a BAT file, but I can’t believe it right now.
Will such a file work?
do(
    rem Установка пакетов npm
    call npm install
)
do(
    rem Установка пакетов bower
    call bower install
)
do(
    rem Сборка проекта
    call gulp build
)
do(
    rem Запуск отслеживания изменения файлов
    call gulp watch
)
do(
    rem Запуск сервера приложения
    call node "./server/app.js"
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2016-04-20
@res2001

Will not.
Remove do() everywhere - there is no such operator in cmd.
Remove call everywhere - it is not needed here.
If the programs being launched (npm, bower, gulp, node) are not in the current directory or in PATH, then you need to write the full paths to the executable files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question