From ffef6616dc00d57baebca57fc92bb832fdab4178 Mon Sep 17 00:00:00 2001 From: Kevin Thompson Date: Mon, 8 Nov 2021 11:08:58 -0800 Subject: [PATCH] fix: Fix error when nohoist is not defined (#10) Fix an error that occurs when nohoist is not defined as in Yarn 2 or 3 since nohoist is deprecated. --- src/get-nohoist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get-nohoist.js b/src/get-nohoist.js index a6bd2e7..d2ca8a2 100644 --- a/src/get-nohoist.js +++ b/src/get-nohoist.js @@ -24,7 +24,7 @@ module.exports = function getNohoist(params = {}) { : getWorkspaces({ cwd }); const monorepoRoot = getMonorepoRoot({ cwd }); const packageJson = require(path.join(monorepoRoot, "package.json")); - const nohoistGlobs = packageJson.workspaces.nohoist; + const nohoistGlobs = packageJson.workspaces.nohoist || []; return nohoistGlobs .map((nohoistGlob) =>