File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,12 @@ async function execNpm(
124124
125125 try {
126126 // Use execFile instead of exec to avoid shell injection vulnerabilities
127- // execFile does not spawn a shell, so metacharacters are passed literally
127+ // On Windows, shell: true is required to execute .cmd files (like npm.cmd)
128+ // On Unix, we keep it false for better security and performance
128129 const { stdout, stderr } = await execFileAsync ( 'npm' , npmArgs , {
129130 timeout : 60000 ,
130131 env : { ...process . env , FORCE_COLOR : '0' } ,
132+ shell : process . platform === 'win32' ,
131133 } )
132134
133135 if ( ! options . silent ) {
@@ -386,6 +388,7 @@ export async function packageInit(
386388 timeout : 60000 ,
387389 cwd : tempDir ,
388390 env : { ...process . env , FORCE_COLOR : '0' } ,
391+ shell : process . platform === 'win32' ,
389392 } )
390393
391394 logSuccess ( `Published ${ name } @0.0.0` )
You can’t perform that action at this time.
0 commit comments