remove out of date lerna references

This commit is contained in:
Ben Irvin 2023-04-14 17:39:05 +02:00
parent 333932fce7
commit 50db2e4402
3 changed files with 1 additions and 33 deletions

View File

@ -21,5 +21,5 @@ Alternatively, you can use [`yarn link`](https://classic.yarnpkg.com/lang/en/doc
Once the link is setup, run the following command from the root of the monorepo
```
yarn lerna clean && yarn setup
yarn clean && yarn setup
```

View File

@ -1,23 +0,0 @@
---
title: How to install packages
slug: /how-to-install-packages
tags:
- lerna
- packages
---
# 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 <package_name> --scope @strapi/<module_name>`** 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.
By using this method, Strapi developers can avoid issues with mismatched package versions or unnecessary dependencies in certain modules. This can help to keep the codebase clean and maintainable, and reduce the potential for conflicts or issues in the future.
Overall, we recommend using **`yarn lerna add`** with the **`--scope`** flag for installing packages in the Strapi mono repo, to ensure consistent and reliable results.
## Resources
- [Lerna Docs](https://futurestud.io/tutorials/lerna-install-dependencies-for-a-specific-package)

View File

@ -188,15 +188,6 @@ const sidebars = {
},
items: [],
},
{
type: 'category',
label: 'How to install packages in a module',
link: {
type: 'doc',
id: 'how-to-install-packages',
},
items: [],
},
],
api: [{ type: 'autogenerated', dirName: 'api' }],
community: [{ type: 'autogenerated', dirName: 'community' }],