Log node and npm version

This commit is contained in:
Josh Gross 2020-04-16 10:45:55 -04:00
parent 83c9f7a7df
commit 52eb8a7524
No known key found for this signature in database
GPG key ID: 17A6308EA2144978
2 changed files with 27 additions and 2 deletions

View file

@ -1,7 +1,9 @@
import * as core from '@actions/core';
import * as io from '@actions/io';
import * as installer from './installer';
import * as auth from './authutil';
import * as path from 'path';
import cp from 'child_process';
async function run() {
try {
@ -17,6 +19,16 @@ async function run() {
await installer.getNode(version);
}
// Output version of node and npm that are being used
console.log(`Installed Node version '${version}.`);
const nodePath = await io.which('node');
const nodeVersion = cp.execSync(`${nodePath} --version`);
console.log(`Node Version: ${nodeVersion}`);
const npmPath = await io.which('npm');
const npmVersion = cp.execSync(`${npmPath} --version`);
console.log(`npm Version: ${npmVersion}`);
const registryUrl: string = core.getInput('registry-url');
const alwaysAuth: string = core.getInput('always-auth');
if (registryUrl) {