DEV Community

Krzysztof Żuraw
Krzysztof Żuraw

Posted on • Originally published at krzysztofzuraw.com on

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"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Your dependency should now be properly linked!

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay