镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Clarify recommended package manager #1645

Description

@mcandre

Node.js still comes with npm as the default package manager. And the official Node.js online documentation continues to list npm commands. However, the official Node.js Docker Hub images strangely contain yarn by default, which is not lockfile compatible with npm.

So which of these two package managers should Node.js users be using? If the answer is npm, then would be good to drop yarn from the next major Node.js release series tags on Docker Hub, in order to provide leaner images. This reduces confusion, storage costs, and network bills.

Activity

  1. aduh95 commented on Nov 10, 2021

    @aduh95
    Contributor

    would be good to drop yarn from the next major Node.js release series tags on Docker Hub, in order to provide leaner images. This reduces confusion, storage costs, and network bills.

    Same apply for npm, do you think we should remove both?

    So which of these two package managers should Node.js users be using?

    Yarn, npm, and Node.js are three distinct projects, with different goals. Node.js users should use whatever suits their use case and their own preference (none, both, another package manager such as pnpm, etc.).

  2. richardlau commented on Feb 17, 2022

    @richardlau
    Member

    Since this is specifically about the Docker images I'm going to transfer this over to https://github.com/nodejs/docker-node as the Docker working group has autonomy for what goes into those images.

  3. transferred this issue fromnodejs/nodeon Feb 17, 2022
  4. bri3d commented on Feb 17, 2022

    @bri3d

    I am a strong advocate for the removal of both package managers from the blessed Docker images.

    Package managers introduce a dependency surface area which makes the docker-node images harder to use in an audited corporate environment and limits their utility. Right now we take the base image, tag an image which uninstalls all package managers from the base image, and then copy our production Node app and dependencies into that image. It would be great not to have to do this, IMO a base image should be a base image.

    It makes much more sense to me to install the package manager that a specific project needs as part of that specific project's build steps than to have multiple package managers included in a base image, as package mangers are a project specific dev dependency.

    Otherwise, users are exposed to these sorts of annoying issues: npm/cli#3785 by default.

  5. SimenB commented on Feb 18, 2022

    @SimenB
    Member

    Discussion about no package manager is duplicate of #404.
    Discussion about only npm, no yarn is duplicate of #777.

    (and note that node itself is embracing more than just npm, ref https://nodejs.org/api/corepack.html, which is available in the current LTS).


    I think we should close this issue, whatever discussion comes out of it are covered in other, existent issues.

    /cc @nodejs/docker

  6. igorpupkinable commented on Apr 11, 2026

    @igorpupkinable

    Corepack removal decision nodejs/TSC#1697 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions