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) {
147
147
}
148
148
149
149
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' ;
150
158
log . error (
151
- ansi . red ( 'Local gulp not found in' ) ,
159
+ ansi . red ( missingGulpMessage ) ,
152
160
ansi . magenta ( tildify ( env . cwd ) )
153
161
) ;
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 ) ) ;
155
167
exit ( 1 ) ;
156
168
}
157
169
You can’t perform that action at this time.
0 commit comments