lerna VS pnpm

Compare lerna vs pnpm and see what are their differences.

lerna

:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository. (by lerna)
Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
lerna pnpm
161 90
35,291 27,371
0.3% 2.2%
9.1 9.8
5 days ago 4 days ago
TypeScript TypeScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

lerna

Posts with mentions or reviews of lerna. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-18.
  • Things I learned while building projects with NX
    5 projects | dev.to | 18 Mar 2024
    Lerna currently maintained by Nx team
  • tsParticles 3.0.0 is out. Breaking changes ahead.
    3 projects | dev.to | 4 Dec 2023
  • Nx 16.8 Release!!!
    5 projects | dev.to | 6 Sep 2023
    On Netlify's enterprise tier, approximately 46% of builds are monorepos, with the majority leveraging Nx and Lerna. Recognizing this trend, Netlify has focused on enhancing the setup and deployment experiences for monorepo projects. In particular they worked on an "automatic monorepo detection" feature. When you connect your project to GitHub, Netlify automatically detects if it's part of a monorepo, reads the relevant settings, and pre-configures your project. This eliminates the need for manual setup. This feature also extends to local development via the Netlify CLI.
  • Mocha/Chai with TypeScript (2023 update)
    3 projects | dev.to | 12 Aug 2023
  • Help with library implementation in a big webapp
    2 projects | /r/webdev | 26 Jun 2023
    This is the exact problem monorepos were born to solve. Not only will a monorepo let you share UI components, you'll be able to gradually add shared application logic as well (for instance, do all of your apps have their own logic for connecting to a database? you could roll that into a shared library with a monorepo). There are a lot of tools for accomplishing this in JS, but probably the most popular is lerna, which is built on top of NX (though lots of teams roll their own monorepo in nx without lerna, which IMO is a totally valid option).
  • How to Build and Publish Your First React NPM Package
    8 projects | dev.to | 9 Jun 2023
    To begin, you need to prepare your environment. A few ways to build a React package include tools like Bit, Storybook, Lerna, and TSDX. However, for this tutorial, you will use a zero-configuration bundler for tiny modules called Microbundle.
  • Utility for making sure that I'm using the right `@types/react`
    2 projects | /r/typescript | 5 Jun 2023
    If so, are you using a monorepo tool like Nx or Lerna? If not, start there and see if it solves your problem.
  • [AskJS] Is there a silver bullet for consuming Typescript libraries in a Monorepo?
    5 projects | /r/javascript | 9 May 2023
    I mean I don't know what your monorepo looks like, but for example infernojs (actually written with typescript) uses lerna, and lerna seems simpler than typescript references
  • Understanding npm Versioning
    3 projects | dev.to | 4 Apr 2023
    Tools for publishing, such as Lerna (when using the --conventional-commit flag), follow this convention when incrementing package versions and generating changelog files.
  • How to split an Angular app into micro-frontend apps
    5 projects | dev.to | 27 Mar 2023
    We could improve part of this by using something like Lerna. With the right configuration, Lerna can be really helpful.

pnpm

Posts with mentions or reviews of pnpm. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-03.
  • Unit Testing in Node.js and TypeScript: A Comprehensive Guide with Jest Integration
    5 projects | dev.to | 3 Mar 2024
    A package manager such as npm, Yarn, or pnpm. A package manager is a tool that helps you manage the dependencies of your project. You can use any of these package managers to install Jest and other packages.
  • Effective nodejs version management for the busy developer
    3 projects | dev.to | 4 Feb 2024
    I also recommend using pnpm as a package manager, it's faster and more efficient than npm or yarn with great capabilities concerning monorepo setup. On recent nodejs versions (v16.13+), you can install it easily with:
  • .dockerignore being ignored by docker-compose? no space left on device
    3 projects | /r/docker | 5 Dec 2023
    FROM node:21-alpine AS base FROM base AS builder Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat RUN apk update Set working directory WORKDIR /app Install pnpm with corepack RUN corepack enable && corepack prepare pnpm@latest --activate Enable pnpm add --global on Alpine Linux by setting home location environment variable to a location already in $PATH https://github.com/pnpm/pnpm/issues/784#issuecomment-1518582235 ENV PNPM_HOME=/usr/local/bin RUN pnpm install turbo --global COPY . . RUN turbo prune web --docker Add lockfile and package.json's of isolated subworkspace FROM base AS installer RUN apk add --no-cache libc6-compat RUN apk update WORKDIR /app First install the dependencies (as they change less often) COPY .gitignore .gitignore COPY --from=builder /app/out/json/ . COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml RUN pnpm install Build the project COPY --from=builder /app/out/full/ . RUN pnpm turbo run build --filter=web FROM base AS runner WORKDIR /app Don't run production as root RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs USER nextjs COPY --from=installer /app/apps/web/next.config.js . COPY --from=installer /app/apps/web/package.json . Automatically leverage output traces to reduce image size https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./ COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public CMD node apps/web/server.js
  • NPMprune: Remove unnecessary files from node_modules to optimize storage
    3 projects | news.ycombinator.com | 29 Nov 2023
    I use https://pnpm.io whenever possible. It has many benefits, the main one is that the node modules are symlinked to one big repo in your home directory, so there isn’t nearly as much duplication.
  • how to manage node modules in every proj?
    2 projects | /r/learnprogramming | 10 Nov 2023
    Also maybe try https://pnpm.io/ which aparently does linking or something for you, havent used it.
  • Yarn 4.0
    10 projects | news.ycombinator.com | 23 Oct 2023
    │ └── tsconfig.json

    Whenever pnpm installs workspace dependencies, it installs them at the root of the workspace, (in the tore inside the docker build image of course, not on the host), and those are the dependencies for all 3 packages all together in one virtual store, here:

    ./node_modules/.pnpm

    So, when I want to create my container image for say packages/app1, I don't see how I could copy only my dependencies for that app from the build image like this:

    COPY --from=deps /app/packages/app2/node_modules/ /app/packages/app2/node_modules

    Because while of course the dependencies are installed in the build image, they are at the root of the workspace in virtual store there, and not in /app/packages/app2/node_modules/ – this directory only contains symlinks to the root virtual store.

    Of course I can copy all the dependencies from the root virtual store of the build image into my image, but then those are the dependencies for ALL packages in the workspace, not just for app1

    I suppose I could try to install only the dependencies for app1, but this is broken with the default pnpm settings at the moment (it still installs dependencies for everything in the workspace)

    https://github.com/pnpm/pnpm/issues/6300

  • Building a Minimalist Docker Image with Node, TypeScript
    4 projects | dev.to | 5 Sep 2023
    FROM node:18.16.0-alpine RUN apk add \ curl \ git \ && rm -rf /var/cache/* \ && mkdir /var/cache/apk RUN mkdir -p /app WORKDIR /app RUN mkdir -p /bin && curl -fsSL "https://github.com/pnpm/pnpm/releases/download/v8.6.3/pnpm-linuxstatic-x64" -o /bin/pnpm; chmod +x /bin/pnpm; ENV PATH /app/node_modules/.bin:$PATH ADD package.json pnpm-lock.yaml .npmrc /app/ RUN pnpm install ADD . /app RUN pnpm run build EXPOSE 5000 CMD [ "pnpm", "start" ]
  • Lockfile merge conflicts, how to handle it correctly?
    3 projects | dev.to | 14 Jul 2023
    The conflict resolution algorithm for pnpm is maintained by the @pnpm/merge-lockfile-changes project.
  • Releasing local.ai - an LLM local playground with minimal setup
    6 projects | /r/LocalLLaMA | 5 Jun 2023
    What version of pnpm are you using? I found this issue, maybe it's related?
  • Why is PNPM not supported in Expo app?
    2 projects | /r/expo | 13 May 2023
    Please check here https://github.com/nrwl/nx-labs/issues/34 and here https://github.com/pnpm/pnpm/issues/1501

What are some alternatives?

When comparing lerna and pnpm you can also consider the following projects:

turborepo - Incremental bundler and build system optimized for JavaScript and TypeScript, written in Rust – including Turborepo and Turbopack. [Moved to: https://github.com/vercel/turbo]

nx - Smart Monorepos · Fast CI

changesets - 🦋 A way to manage your versioning and changelogs with a focus on monorepos

berry - 📦🐈 Active development trunk for Yarn ⚒

yarn - The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry

webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

single-spa - The router for easy microfrontends

husky - Git hooks made easy 🐶 woof!

deno - A modern runtime for JavaScript and TypeScript.

npm

Bower - A package manager for the web