From 13bf61f705dcabd4a19c0cf45b1e33bc566a4fc3 Mon Sep 17 00:00:00 2001 From: Nikita Shiryakov Date: Thu, 23 Feb 2017 20:17:53 +0300 Subject: [PATCH] Fix cmd command for Windows In Windows string './node_modules/.bin/' must be enclosed in double quotes, as it contains character '.' (dot). Otherwise, you will get the error: '.' is not recognized as an internal or external command, operable program or batch file. --- build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index 550e70e..374f241 100644 --- a/build.js +++ b/build.js @@ -2,12 +2,12 @@ var exec = require('child_process').exec; var executable = (!process.argv[3].indexOf('server')) ? 'webpack-dev-server' : 'webpack'; -var cmdLine = './node_modules/.bin/' + executable; +var cmdLine = '"./node_modules/.bin/' + executable + '"'; var environ = (!process.argv[2].indexOf('development')) ? 'development' : 'production'; var command; if (process.platform === 'win32') { - cmdLine = 'set NODE_ENV=' + environ + '&& ' + cmdLine; + cmdLine = 'set NODE_ENV=' + environ + ' && ' + cmdLine; } else { cmdLine = 'NODE_ENV=' + environ + ' ' + cmdLine; }