From b3259ea1e881e5ba1b050f2fb0ec85e789bc4f49 Mon Sep 17 00:00:00 2001 From: shaun554 Date: Mon, 3 Dec 2018 11:21:34 +0800 Subject: [PATCH] fix($core): `vuepress dev` broken on nodejs v10 and greater (close: #1063) (close: #1064) Refs: - https://github.com/nodejs/node/issues/21203 - https://github.com/nodejs/node/commit/cbc3ef64ceaf95ec1d0d1535211ce3a6945407e1 --- packages/@vuepress/core/lib/dev.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vuepress/core/lib/dev.js b/packages/@vuepress/core/lib/dev.js index 2b373cc..e05f255 100644 --- a/packages/@vuepress/core/lib/dev.js +++ b/packages/@vuepress/core/lib/dev.js @@ -80,7 +80,8 @@ module.exports = async function dev (sourceDir, cliOptions = {}) { const { host, displayHost } = await resolveHost(cliOptions.host || ctx.siteConfig.host) // debug in a running dev process. - process.stdout.on('data', chunk => { + process.stdin && + process.stdin.on('data', chunk => { const parsed = chunk.toString('utf-8').trim() if (parsed === '*') { console.log(Object.keys(ctx))