From 3179434000a6dca5ac864a0f43636abb79c7c020 Mon Sep 17 00:00:00 2001 From: rccoder Date: Sun, 30 Jun 2019 15:12:17 +0800 Subject: [PATCH] fix(midway-init): Internal employees can not use the external network midway --- packages/midway-init/bin/midway-init.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/midway-init/bin/midway-init.js b/packages/midway-init/bin/midway-init.js index a74539003eff..8ae929904c26 100755 --- a/packages/midway-init/bin/midway-init.js +++ b/packages/midway-init/bin/midway-init.js @@ -40,7 +40,10 @@ co(function* () { // 判断是否处于内网环境 function isInternal() { try { - const { stdout } = childProcess.spawnSync('tnpm', [ 'view', '@ali/midway-init', '--json' ]); + const { stdout } = childProcess.spawnSync('tnpm', [ 'view', '@ali/midway-init', '--json'], { + timeout: 3000 + }); + const npmData = JSON.parse(stdout.toString(), null, 2); if (npmData.name === '@ali/midway-init') {