Answer the question
In order to leave comments, you need to log in
How to force npm to run in a row in a .bat file?
In general, the essence is this. I read this tutorial here and decided that I fell into the future (for now I'm just practicing all this (layout, etc.), if anything) to go into the console every time and prescribe all the commands. Therefore, I decided to make a small batch file that would run everything I needed in order without my intervention. The problem is that if you run the installation via npm directly with a batch file:
echo Install Gulp autoprefixer
npm install --save-dev gulp-autoprefixer
pause
echo Install Gulp autoprefixer
start start_file\plugin\gulp-autoprefixer.bat
pause
@echo off
title Creating an assembly template
color 0F
echo Creating a Project Structure
pause
mkdir build
mkdir src
dir > index.html
mkdir src\js
mkdir src\js\partials
cd src\js
dir > main.js
cd ..
rem возращаемся в src
cd ..
rem возращаемся в папку проекта
mkdir src\img
mkdir src\fonts
mkdir src\style
mkdir src\style\partials
cd src\style
dir > main.css
cd ..
rem возращаемся в src
cd ..
rem возращаемся в папку проекта
mkdir src\template
echo This part of the batch file creates bower.json
pause
start start_file\json\bower.bat
echo This part of the batch file creates package.json
pause
start start_file\json\package.bat
echo Install the gulp with the --save-dev flag
pause
start start_file\plugi\gulp.bat
echo This part of the batch file installs the gulp plugins with the --save-dev flag
pause
echo Install Gulp autoprefixer
start start_file\plugin\gulp-autoprefixer.bat
pause
echo Install Gulp clean css
start start_file\plugin\gulp-clean-css.bat
pause
echo Install Gulp imagemin
start start_file\plugin\gulp-imagemin.bat
pause
echo Install Gulp uglify
start start_file\plugin\gulp-uglify.bat
pause
echo Install Gulp sass
start start_file\plugin\gulp-sass.bat
pause
echo Install Gulp sourcemaps
start start_file\plugin\gulp-sourcemaps.bat
pause
echo Install Gulp rigger
start start_file\plugin\gulp-rigger.bat
pause
echo Install Gulp watch
start plugin\gulp-watch.bat
pause
echo Install Rimraf
start start_file\plugin\rimraf.bat
pause
exit
@echo off
npm install --save-dev gulp-autoprefixer
Answer the question
In order to leave comments, you need to log in
But no matter how they do it wrong ...
Once they set up all the directories and that's it. Then only three commands ->
git clone url/to/project
npm i
npm run serve
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question