Fix deletion of node_modules in DT test

del needs to have `{ force: true }` passed so that it can delete
node_modules outside the working directory
This commit is contained in:
Nathan Shively-Sanders 2018-01-18 08:30:31 -08:00
parent be607bd28f
commit 24c2fcc504

View file

@ -61,7 +61,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
fs.unlinkSync(path.join(cwd, "package-lock.json"));
}
if (fs.existsSync(path.join(cwd, "node_modules"))) {
require("del").sync(path.join(cwd, "node_modules"));
require("del").sync(path.join(cwd, "node_modules"), { force: true });
}
const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout, shell: true, stdio });
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed: ${install.stderr.toString()}`);