Skip to content

Commit cd1ecaa

Browse files
committed
fix: log the output of npm whoami command
1 parent a0120d2 commit cd1ecaa

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/verify-auth.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,25 @@ module.exports = async (npmrc, pkg, context) => {
99
const {
1010
cwd,
1111
env: {DEFAULT_NPM_REGISTRY = 'https://registry.npmjs.org/', ...env},
12+
stdout,
13+
stderr,
1214
} = context;
1315
const registry = getRegistry(pkg, context);
1416

1517
await setNpmrcAuth(npmrc, registry, context);
1618

1719
if (normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY)) {
1820
try {
19-
await execa('npm', ['whoami', '--userconfig', npmrc, '--registry', registry], {cwd, env});
21+
const whoamiResult = execa('npm', ['whoami', '--userconfig', npmrc, '--registry', registry], {cwd, env});
22+
whoamiResult.stdout.pipe(
23+
stdout,
24+
{end: false}
25+
);
26+
whoamiResult.stderr.pipe(
27+
stderr,
28+
{end: false}
29+
);
30+
await whoamiResult;
2031
} catch (_) {
2132
throw new AggregateError([getError('EINVALIDNPMTOKEN', {registry})]);
2233
}

0 commit comments

Comments
 (0)