From 7c7f86e48f875f19bf3f23835e0e48d7c5d4c73d Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Tue, 5 Sep 2023 08:41:44 -0400 Subject: [PATCH 1/2] Use type from packageManager class --- code/lib/cli/src/add.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/cli/src/add.ts b/code/lib/cli/src/add.ts index a163e1f1e34f..71437b314b1c 100644 --- a/code/lib/cli/src/add.ts +++ b/code/lib/cli/src/add.ts @@ -91,6 +91,6 @@ export async function add( await writeConfig(main); if (!options.skipPostinstall && isStorybookAddon) { - await postinstallAddon(addonName, { packageManager: pkgMgr }); + await postinstallAddon(addonName, { packageManager: packageManager.type }); } } From 0a4c50461ba9791b7f3904f1d4d7f0e1ca8eea69 Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Tue, 5 Sep 2023 08:42:55 -0400 Subject: [PATCH 2/2] Use npx if user has yarn1 --- code/addons/themes/postinstall.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/themes/postinstall.js b/code/addons/themes/postinstall.js index c84a4e88e4b4..01a9b3151e89 100644 --- a/code/addons/themes/postinstall.js +++ b/code/addons/themes/postinstall.js @@ -2,7 +2,7 @@ const { spawn } = require('child_process'); const PACKAGE_MANAGER_TO_COMMAND = { npm: 'npx', - yarn1: 'yarn dlx', + yarn1: 'npx', yarn2: 'yarn dlx', pnpm: 'pnpm dlx', };