Skip to content

pnpm env use doesn't provide the corepack binary #4029

@haoqunjiang

Description

@haoqunjiang

pnpm version:

6.23.0

Code to reproduce the issue:

pnpm env use --global lts
corepack enable

Expected behavior:

Corepack is successfully enabled

Actual behavior:

zsh: command not found: corepack

Actually, corepack can be found at $PNPM_HOME/nodejs/16.13.0/lib/node_modules/corepack but no link is added at $PNPM_HOME, thus the command is not found in $PATH.

Is this intended?

Background:
I'm setting up my new laptop and I'd like to use pnpm to manage my node versions, so I followed the installation guide to install pnpm via shell script. But I need yarn for some of my projects. The current recommended way to install yarn is via corepack. That's when I found out it doesn't work in a pnpm-managed Node.js environment.

Additional information:

  • node -v prints: v16.13.0
  • Windows, macOS, or Linux?: macOS 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Priority

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions