File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15228,8 +15228,11 @@ function run() {
1522815228 const nodeVersion = child_process_1.default.execSync(`${nodePath} --version`);
1522915229 console.log(`Node Version: ${nodeVersion}`);
1523015230 const npmPath = yield io.which('npm');
15231- const npmVersion = child_process_1.default.execSync(`${npmPath} --version`);
15232- console.log(`npm Version: ${npmVersion}`);
15231+ // Older versions of Node don't include npm
15232+ if (npmPath) {
15233+ const npmVersion = child_process_1.default.execSync(`${npmPath} --version`);
15234+ console.log(`npm Version: ${npmVersion}`);
15235+ }
1523315236 const registryUrl = core.getInput('registry-url');
1523415237 const alwaysAuth = core.getInput('always-auth');
1523515238 if (registryUrl) {
Original file line number Diff line number Diff line change @@ -25,8 +25,11 @@ async function run() {
2525 console . log ( `Node Version: ${ nodeVersion } ` ) ;
2626
2727 const npmPath = await io . which ( 'npm' ) ;
28- const npmVersion = cp . execSync ( `${ npmPath } --version` ) ;
29- console . log ( `npm Version: ${ npmVersion } ` ) ;
28+ // Older versions of Node don't include npm
29+ if ( npmPath ) {
30+ const npmVersion = cp . execSync ( `${ npmPath } --version` ) ;
31+ console . log ( `npm Version: ${ npmVersion } ` ) ;
32+ }
3033
3134 const registryUrl : string = core . getInput ( 'registry-url' ) ;
3235 const alwaysAuth : string = core . getInput ( 'always-auth' ) ;
You can’t perform that action at this time.
0 commit comments