Skip to content

Commit c1b261c

Browse files
bdukesphated
authored andcommitted
Fix: Avoid recommending npm if yarn should be used (#158)
1 parent d827191 commit c1b261c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,15 @@ function handleArguments(env) {
162162
ansi.red(missingGulpMessage),
163163
ansi.magenta(tildify(env.cwd))
164164
);
165+
var hasYarn = fs.existsSync(path.join(env.cwd, 'yarn.lock'));
165166
/* istanbul ignore next */
166167
var installCommand =
167168
missingNodeModules
168-
? 'npm install'
169+
? hasYarn
170+
? 'yarn install'
171+
: 'npm install'
172+
: hasYarn
173+
? 'yarn add gulp'
169174
: 'npm install gulp';
170175
log.error(ansi.red('Try running: ' + installCommand));
171176
exit(1);

0 commit comments

Comments
 (0)