File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -147,11 +147,23 @@ function handleArguments(env) {
147147 }
148148
149149 if ( ! env . modulePath ) {
150+ var missingNodeModules =
151+ fs . existsSync ( path . join ( env . cwd , 'package.json' ) )
152+ && ! fs . existsSync ( path . join ( env . cwd , 'node_modules' ) ) ;
153+
154+ var missingGulpMessage =
155+ missingNodeModules
156+ ? 'Local modules not found in'
157+ : 'Local gulp not found in' ;
150158 log . error (
151- ansi . red ( 'Local gulp not found in' ) ,
159+ ansi . red ( missingGulpMessage ) ,
152160 ansi . magenta ( tildify ( env . cwd ) )
153161 ) ;
154- log . error ( ansi . red ( 'Try running: npm install gulp' ) ) ;
162+ var installCommand =
163+ missingNodeModules
164+ ? 'npm install'
165+ : 'npm install gulp' ;
166+ log . error ( ansi . red ( 'Try running: ' + installCommand ) ) ;
155167 exit ( 1 ) ;
156168 }
157169
You can’t perform that action at this time.
0 commit comments