@@ -251,33 +251,7 @@ export function setup(cwd = process.cwd()) {
251251 * @param {ExecOptions } [options]
252252 * @return {Promise<ExecResult> }
253253 */
254- async npm ( args = [ ] , options = { } ) {
255- // First try to use NPM_PATH from environment (set by CI)
256- if ( process . env . NPM_PATH ) {
257- try {
258- await fs . access ( process . env . NPM_PATH ) ;
259- console . log ( `Using npm from NPM_PATH: ${ process . env . NPM_PATH } ` ) ;
260- return exec ( process . env . NPM_PATH , args , options ) ;
261- } catch ( err ) {
262- console . log ( `npm at NPM_PATH not accessible: ${ err . message } ` ) ;
263- }
264- }
265-
266- // Try to find npm in the same directory as node
267- const nodePath = process . execPath ;
268- const nodeDir = path . dirname ( nodePath ) ;
269- const npmPath = path . join ( nodeDir , "npm" ) ;
270-
271- try {
272- await fs . access ( npmPath ) ;
273- console . log ( `Using npm from Node.js directory: ${ npmPath } ` ) ;
274- return exec ( npmPath , args , options ) ;
275- } catch ( err ) {
276- console . log ( `npm not found in Node.js directory: ${ err . message } ` ) ;
277- }
278-
279- // Final fallback to direct npm execution
280- console . log ( "Falling back to direct npm execution" ) ;
254+ npm ( args = [ ] , options = { } ) {
281255 return exec ( "npm" , args , options ) ;
282256 } ,
283257 } ;
0 commit comments