From c1b261c80f75c7576f42800e6f6e338cb6277f48 Mon Sep 17 00:00:00 2001 From: Brian Dukes Date: Wed, 20 May 2020 00:45:02 -0500 Subject: [PATCH] Fix: Avoid recommending npm if yarn should be used (#158) --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d01d3c85..65be0b71 100644 --- a/index.js +++ b/index.js @@ -162,10 +162,15 @@ function handleArguments(env) { ansi.red(missingGulpMessage), ansi.magenta(tildify(env.cwd)) ); + var hasYarn = fs.existsSync(path.join(env.cwd, 'yarn.lock')); /* istanbul ignore next */ var installCommand = missingNodeModules - ? 'npm install' + ? hasYarn + ? 'yarn install' + : 'npm install' + : hasYarn + ? 'yarn add gulp' : 'npm install gulp'; log.error(ansi.red('Try running: ' + installCommand)); exit(1);