Skip to content

Prepare Yarn v1 removal in Node.js 26 images #2407

Description

@MikeMcC399

Problem

  • Images include Yarn v1 by default

  • TSC endorsed the removal of Yarn v1 for images based on Node.js 26 and above as currently described in Yarn v1 Classic bundling

Suggested Solution

  • Update each of the template files to add beginning and end markers for the Yarn installation section

    • Dockerfile-alpine.template

    • Dockerfile-debian.template

    • Dockerfile-slim.template

      # YARN_INSTALLATION_START
      ENV YARN_VERSION=0.0.0
      
      RUN set -ex \
      # use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
      && export GNUPGHOME="$(mktemp -d)" \
          ...
      # smoke test
      && yarn --version \
      && rm -rf /tmp/*
      # YARN_INSTALLATION_END
  • In update.sh use sed to remove the marked Yarn installation section for version >= 26 when specific Dockerfiles are created based on the templates

  • Update documentation accordingly

  • This should be implemented before the planned release date of Node.js 26.0.0 on 2026-04-22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions