Remove package-lock.json before npm install

This commit is contained in:
Nathan Shively-Sanders 2017-11-07 11:10:24 -08:00
parent 88a31d6096
commit 5e5b5652ed

View file

@ -37,6 +37,9 @@ class DefinitelyTypedRunner extends RunnerBase {
const cwd = path.join(__dirname, "../../", DefinitelyTypedRunner.testDir, directoryName);
const timeout = 600000; // 600s = 10 minutes
if (fs.existsSync(path.join(cwd, "package.json"))) {
if (fs.existsSync(path.join(cwd, "package-lock.json"))) {
fs.unlinkSync(path.join(cwd, "package-lock.json"));
}
const stdio = isWorker ? "pipe" : "inherit";
const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout, shell: true, stdio });
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed!`);