From 67b7a335dec0ed3dab430d49000d8f1c008f59c7 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Tue, 7 Mar 2017 14:50:34 -0500 Subject: [PATCH] [dev] use .cmd versions for Windows Since spawn on Windows can't accept scripts like exec can :( --- scripts/postinstall.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/postinstall.es6 b/scripts/postinstall.es6 index f957dc663..d3ecb97ee 100644 --- a/scripts/postinstall.es6 +++ b/scripts/postinstall.es6 @@ -77,7 +77,9 @@ const npmEnvs = { async function npm(cmd, options) { const {cwd, env} = Object.assign({cwd: '.', env: 'system'}, options); - await spawn("npm", [cmd], { + let npmCmd = "npm" + if (process.platform === "win32") { npmCmd = "npm.cmd" } + await spawn(npmCmd, [cmd], { cwd: path.resolve(__dirname, '..', cwd), env: npmEnvs[env], })