@@ -4,7 +4,7 @@ import { homedir, platform } from 'node:os'
44import { existsSync , readFileSync } from 'node:fs'
55import { rimraf } from 'rimraf'
66import { chmod as fsChmod , writeFile } from 'node:fs/promises'
7- import { execaCommand as exec , type Options } from 'execa'
7+ import { execa as execFile , execaCommand as exec , type Options } from 'execa'
88import { ensureDir , move , pathExists } from 'fs-extra'
99import { downloadAndInstallPnpm } from './pnpm'
1010
@@ -313,23 +313,23 @@ if (packageJsonChanged) {
313313
314314 const pnpmExec = kitPath ( pnpmFile )
315315 console . log ( `Checking node path with pnpm node -e at ${ pnpmExec } ` )
316- await exec ( `" ${ pnpmExec } " node -e " console.log(process.execPath)"` , {
316+ await execFile ( pnpmExec , [ ' node' , '-e' , ' console.log(process.execPath)' ] , {
317317 cwd : kitPath ( ) ,
318318 stdio : 'inherit' ,
319319 env : {
320320 PNPM_HOME : kitPath ( ) ,
321- PATH : ''
321+ PATH : process . env . PATH
322322 }
323323 } )
324324 console . log ( 'Node path check completed' )
325325
326326 const pnpmPath = kitPath ( pnpmFile )
327327 console . log ( `Installing production dependencies using ${ pnpmPath } ...` )
328- await exec ( `" ${ pnpmPath } " i --prod` , options )
328+ await execFile ( pnpmPath , [ 'i' , ' --prod' ] , { cwd : kitPath ( ) , stdio : 'inherit' } )
329329 console . log ( 'Production dependencies installed successfully' )
330330
331331 console . log ( 'Installing development tools (esbuild, vite, tsx)...' )
332- await exec ( `" ${ pnpmPath } " i esbuild vite tsx` , options )
332+ await execFile ( pnpmPath , [ 'i' , ' esbuild' , ' vite' , ' tsx' ] , { cwd : kitPath ( ) , stdio : 'inherit' } )
333333 console . log ( 'Development tools installed successfully' )
334334 } catch ( error ) {
335335 console . error ( 'Error installing dependencies:' , error )
@@ -347,11 +347,11 @@ if (packageJsonChanged) {
347347
348348 const pnpmPath = kitPath ( pnpmFile )
349349 console . log ( `Installing production dependencies using ${ pnpmPath } ...` )
350- await exec ( `" ${ pnpmPath } " i --prod` , options )
350+ await execFile ( pnpmPath , [ 'i' , ' --prod' ] , { cwd : kitPath ( ) , stdio : 'inherit' } )
351351 console . log ( 'Production dependencies installed successfully' )
352352
353353 console . log ( 'Installing development tools (esbuild, vite, tsx)...' )
354- await exec ( `" ${ pnpmPath } " i esbuild vite tsx` , options )
354+ await execFile ( pnpmPath , [ 'i' , ' esbuild' , ' vite' , ' tsx' ] , { cwd : kitPath ( ) , stdio : 'inherit' } )
355355 console . log ( 'Development tools installed successfully' )
356356 } catch ( error ) {
357357 console . error ( 'Error installing dependencies:' , error )
0 commit comments