From ad90a9d34c2d765b81f2414062b6e0b8f6010353 Mon Sep 17 00:00:00 2001 From: cpselvis Date: Fri, 8 Nov 2019 20:55:54 +0800 Subject: [PATCH] fix(core): fix init error when choose package manager --- package.json | 2 +- src/core/index.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bd5056d7..4fe0ca88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@feflow/cli", - "version": "0.16.0-beta.4", + "version": "0.16.0-beta.5", "description": "A front-end flow tool.", "main": "./lib/index.js", "files": [ diff --git a/src/core/index.ts b/src/core/index.ts index 1abef60d..d65d2e72 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -124,10 +124,12 @@ export default class Feflow { checkUpdate() { const { root, rootPkg, config, logger } = this; - const table = new Table(); + if (!config) { + return; + } + const table = new Table(); const packageManager = config.packageManager; - return Promise.all(this.getInstalledPlugins().map(async (name: any) => { const pluginPath = path.join(root, 'node_modules', name, 'package.json'); const content: any = fs.readFileSync(pluginPath);