Compare commits

...

7 Commits

Author SHA1 Message Date
Chris Barber
c76e721251 Debug all paths 2023-12-01 23:11:26 -06:00
Chris Barber
2913ed4cf2 Another debug log 2023-12-01 22:13:21 -06:00
Chris Barber
b99259edba More debug 2 2023-12-01 16:40:11 -06:00
Chris Barber
bfac1f4c3a More debug 2023-12-01 16:38:54 -06:00
Chris Barber
b05c76817d Debug path 2023-12-01 15:35:36 -06:00
Chris Barber
84ab7b2444 Put debug log in correct place 2023-12-01 14:41:10 -06:00
Chris Barber
cf3dddac9c Debug node-gyp 2023-12-01 14:15:56 -06:00

View File

@@ -4,7 +4,7 @@ import path from 'path';
import Sema from 'async-sema';
import spawn from 'cross-spawn';
import { coerce, intersects, validRange } from 'semver';
import { SpawnOptions } from 'child_process';
import { SpawnOptions, execFileSync } from 'child_process';
import { deprecate } from 'util';
import debug from '../debug';
import { NowBuildError } from '../errors';
@@ -487,6 +487,35 @@ export async function runNpmInstall(
commandArgs.push('--production');
}
console.log(`PATH=${process.env.PATH}`);
const paths = (process.env.PATH || '').split(path.delimiter);
for (const p of paths) {
try {
console.log(p);
console.log(execFileSync('ls', ['-la', p]).toString().trim());
} catch (e) {
console.log(e);
}
}
for (const bin of ['node', 'npm', 'yarn', 'pnpm', 'turbo', 'node-gyp']) {
try {
console.log(`which ${bin}`);
console.log(execFileSync('which', [bin]).toString().trim());
} catch (e) {
console.log(e);
}
}
try {
console.log(
`Global node-gyp version: ${execFileSync('node-gyp', ['-v'])
.toString()
.trim()}!`
);
} catch (e) {
console.log('node-gyp not found!');
console.log(e);
}
try {
await spawnAsync(cliType, commandArgs, opts);
} catch (err: unknown) {