Logo

dev-resources.site

for different kinds of informations.

How to link a local npm dependency with pnpm

Published at
8/13/2023
Categories
pnpm
javascript
dependencies
Author
Krzysztof Ε»uraw
Categories
3 categories in total
pnpm
open
javascript
open
dependencies
open
How to link a local npm dependency with pnpm

I have learned how to correctly link a local npm dependency when using pnpm. Here is the process:

  1. Execute pnpm install ./your-library.tgz.
  2. Include the following code in your package.json file:
{
  "pnpm": {
    "overrides": {
      "your-library": "file:./your-library.version.tgz"
    }
  }
}

Your dependency should now be properly linked!

Featured ones: