From df846baf729c3dea07d96285f70fbb4765e739fa Mon Sep 17 00:00:00 2001 From: Christian Capeans Date: Fri, 24 Feb 2023 14:30:15 +0100 Subject: [PATCH] Add possible error using yarn --- docs/docs/how-to-install-packages.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/how-to-install-packages.md b/docs/docs/how-to-install-packages.md index d2fdff4fdf..a8881d996a 100644 --- a/docs/docs/how-to-install-packages.md +++ b/docs/docs/how-to-install-packages.md @@ -8,7 +8,9 @@ tags: # Best practices for installing packages in Strapi -When working with the Strapi monorepo, it's important to follow best practices for installing packages to avoid potential issues and ensure consistent results. Instead of using the standard **`yarn add`** command, we recommend using **`yarn lerna add --scope @strapi/`** for installing packages. +When working with the Strapi monorepo, it's important to follow best practices for installing packages to avoid potential issues and ensure consistent results. Instead of using the standard **`yarn add`** command, we recommend using **`yarn lerna add --scope @strapi/`** for installing packages. Actually, you may encounter the following error using `yarn add`: + +`An unexpected error occurred: "expected workspace package to exist for \"@typescript-eslint/typescript-estree\'` This approach uses Lerna, a tool for managing JavaScript projects with multiple packages, to ensure that the package is installed in the correct location(s) and version across all modules that include it. The **`--scope`** flag specifies the specific module(s) that the package should be installed in, ensuring that it's only installed where it's needed.