@@ -8,6 +8,7 @@ const http = require('http')
8
8
const httpProxy = require ( 'http-proxy' )
9
9
const waitPort = require ( 'wait-port' )
10
10
const getPort = require ( 'get-port' )
11
+ const which = require ( 'which' )
11
12
const chokidar = require ( 'chokidar' )
12
13
const proxyMiddleware = require ( 'http-proxy-middleware' )
13
14
const cookie = require ( 'cookie' )
@@ -320,7 +321,7 @@ function serveRedirect(req, res, proxy, match, options) {
320
321
return proxy . web ( req , res , options )
321
322
}
322
323
323
- function startDevServer ( settings , log ) {
324
+ async function startDevServer ( settings , log ) {
324
325
if ( settings . noCmd ) {
325
326
const StaticServer = require ( 'static-server' )
326
327
@@ -341,7 +342,7 @@ function startDevServer(settings, log) {
341
342
342
343
log ( `${ NETLIFYDEVLOG } Starting Netlify Dev with ${ settings . type } ` )
343
344
const args = settings . command === 'npm' ? [ 'run' , ...settings . args ] : settings . args
344
- const ps = child_process . spawn ( settings . command , args , {
345
+ const ps = child_process . spawn ( await which ( settings . command ) , args , {
345
346
env : { ...settings . env , FORCE_COLOR : 'true' } ,
346
347
stdio : settings . stdio || 'inherit' ,
347
348
detached : true ,
@@ -436,7 +437,7 @@ class DevCommand extends Command {
436
437
}
437
438
settings . port = port
438
439
439
- startDevServer ( settings , this . log )
440
+ await startDevServer ( settings , this . log )
440
441
441
442
// serve functions from zip-it-and-ship-it
442
443
// env variables relies on `url`, careful moving this code
0 commit comments