Prevents exception on PnP (#9951)

This commit is contained in:
Maël Nison 2019-05-06 17:37:29 +02:00 committed by Nicolò Ribaudo
parent 84961ebb05
commit d7801c644c
No known key found for this signature in database
GPG Key ID: 6F2E38DF3E4A6D0C

View File

@ -73,7 +73,12 @@ getV8Flags(function(err, v8Flags) {
const kexec = require("kexec");
kexec(process.argv[0], args);
} catch (err) {
if (err.code !== "MODULE_NOT_FOUND") throw err;
if (
err.code !== "MODULE_NOT_FOUND" &&
err.code !== "UNDECLARED_DEPENDENCY"
) {
throw err;
}
const child_process = require("child_process");
const proc = child_process.spawn(process.argv[0], args, {