GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Vite+ and corepack-like functionality · Issue #1309 · voidzero-dev/vite-plus

Vite+ and corepack-like functionality #1309

New issue
Copy link
New issue
Copy link
Closed
#1808
Closed
Vite+ and corepack-like functionality#1309
#1808
Copy link
Assignees
fengmk2
Labels
enhancementNew feature or request
Milestone
Beta

Description

@rChaoz
rChaoz
opened on Apr 5, 2026
Issue body actions

Describe the bug

TL;DR Using Vite+ without an existing Node installation means no corepack, so any scripts/commands that try to run pnpm/yarn fail. Corepack can be installed, but will manage its own versions of pnpm/yarn, same as Vite+, leading to differences between running pnpm i and vp i.

Also, this is a little bit of a dupe of #858 (sorry, didn't see it before opening this 😞), but I think this issue better explains the problem & proposes a better solution.


I tried cloning the vite-plus repo according to the contribution guide with just init, and I've encountered some problems. I decided to document this here as I think it has some value regarding vp as a full-featured tool for everything JS-related, which seems to be its goal, and does very well at it too.

I'll start by saying that I removed nvm and associated global node installations first, to rely only on vp env. The issue described here is encountered by anyone that uses vp env for managing Node, without an existing node installation.

just init tries to run pnpm install, but fails with:

Error: Command failed: pnpm install --no-frozen-lockfile
'pnpm' is not recognized as an internal or external command, operable program or batch file.

Makes sense, since it downloaded a new node version. Normally, I'd enable corepack when I see this, but this doesn't work:

> corepack enable
corepack: The term 'corepack' is not recognized as a name of a cmdlet, function, script file, or executable program.
> npm list -g
C:\Users\Matei\.vite-plus\js_runtime\node\24.14.1
+-- [email protected]
`-- [email protected]

Corepack is there, but Vite+ did not create a shim for it in ~/.vite-plus/bin. Vite+ does create shims for global packages, when using npm i -g or vp i -g. But since corepack comes preinstalled with node, this never happens.

Note: Both npm i -g and vp i -g, from my understanding, install a package globally, but for a specific node version. yarn ... will always run on the Node version I installed it with, not the dynamic Node version (based on .node-version or package.json#engines). It will remain stuck on whatever node version I happened to be using, which does depend on CWD, .node-version etc., forever. This seems like a potential design flaw, but I may be wrong, and regardless it's not related to the current issue. I thought it was worth pointing out, especially since it's not documented.

Continuing, the problem is that trying to call package managers directly, which relies on corepack, doesn't work out of the box. This includes vite-plus itself, as it runs pnpm directly. This can be fixed easily, however, by running:

vp i -g corepack

This works, but IMO is not "clean". Corepack now downloads and manages package manager versions independently of Vite+, so depending on whether you use vp add or pnpm add, a different installation (which may or may not be the same version) is used, as well as with a different node version.

My suggestions to address this, the first one being IMO the best:

  • Vite+ should implement corepack capabilities itself. It already does this when using vp i, vp add etc., which install and run the correct package manager and version automatically. The only piece missing is shimming the actual yarn, pnpm etc. executables by default.
  • If not, at least include some documentation on its environment page that corepack is not available by default, and vp install, vp add etc. should be used instead. However, I do think some people will be turned away by this - some people will simply not want to adjust their workflows (scripts, muscle memory) to use vp instead of pnpm.

If this is out of scope, and vp only wants to support managing package managers for its own commands, then:

  • Document on its environment page that corepack is not available by default, and that it should be installed with vp install -g corepack. Even as Node will no longer come with corepack by default from now on, this information would still be useful.
  • Automatically run vp install -g corepack when installing vp, or an equivalent.

Reproduction

  1. Make sure there is no global Node installation and you're only relying on vp env
  2. Try to clone/work on any repo which uses pnpm/yarn commands

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue for the same bug.
  • Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
  • The provided reproduction is a minimal reproducible example.
Reacted by jak-ch-ll, Christian Koch, Christian Koch, David Hoff-Vanoni, Max, haruna and Ray

Activity

  1. rChaoz
    added
    pending triage
    on Apr 5, 2026
  2. rChaoz
    added the
    Bug
    issue type on Apr 5, 2026
  3. fengmk2 commented on Apr 7, 2026

    @fengmk2
    fengmk2
    on Apr 7, 2026
    Member
    More actions

    #858 (comment) we can consider adding corepack to the default shims tool list. cc @cpojer

    Reacted by Alexander Lichter and Max
  4. fengmk2
    assigned
    cpojer
    on Apr 7, 2026
  5. cpojer commented on Apr 7, 2026

    @cpojer
    cpojer
    on Apr 7, 2026
    Member
    More actions

    Yeah I think we should add the shim, until there is a proper alternative that everyone is happy to use.

    Reacted by MK (fengmk2) and Roman
  6. cpojer
    assigned
    fengmk2
    and unassigned
    cpojer
    on Apr 7, 2026
  7. rChaoz commented on Apr 8, 2026

    @rChaoz
    rChaoz
    on Apr 8, 2026
    ContributorAuthor
    More actions

    Is there a reason why corepack would be added instead of adding shims for yarn, pnpm that simply call the vp pm equivalents?

    Reacted by Christian Koch and Christian Koch
  8. p-j commented on Apr 20, 2026

    @p-j
    p-j
    on Apr 20, 2026
    More actions

    vp pm doesn't support the yarn plugin ... commands, so it's not a full replacement to having access to the correct version of yarn for instance.

    Reacted by David Hoff-Vanoni
  9. fengmk2 commented on May 9, 2026

    @fengmk2
    fengmk2
    on May 9, 2026
    Member
    More actions

    @p-j follow up here #1539

  10. fengmk2
    added
    enhancementNew feature or request
    and removed
    pending triage
    on May 9, 2026
  11. fengmk2
    removed the
    Bug
    issue type on May 9, 2026
  12. fengmk2
    added this to the Beta milestone on May 20, 2026
  13. fengmk2
    marked Shim for pnpm & yarn #858 as a duplicate of this issue on Jun 10, 2026
  14. sapphi-red commented on Jun 10, 2026

    @sapphi-red
    sapphi-red
    on Jun 10, 2026
    More actions

    Using corepack would that mean the same pnpm version will be downloaded twice (one for corepack and one for viteplus), not a big deal though.

    Reacted by JongKyung Lee
  15. fengmk2 commented on Jun 10, 2026

    @fengmk2
    fengmk2
    on Jun 10, 2026
    Member
    More actions

    @sapphi-red The double-install issue is currently unavoidable. If we choose to use corepack, then pnpm and yarn shims have to be managed by corepack. As users get used to the Vite+ Global CLI, we still hope everyone can use the vp command directly instead of pnpm. 😢

    Reacted by 翠
    Reacted by JongKyung Lee
  16. fengmk2
    added 3 commits that reference this issue on Jun 11, 2026

    feat(env): add corepack to the default shims tool list

    This issue will close once commit ddc5a4a is merged into the 'main' branch.
    ddc5a4a

    feat(env): add corepack to the default shims tool list

    This issue will close once commit 0d7d036 is merged into the 'main' branch.
    0d7d036

    feat(env): add corepack to the default shims tool list (#1808)

    This issue will close once commit b48e0a0 is merged into the 'main' branch.
    b48e0a0
  17. fengmk2
    closed this as completedin #1808on Jun 13, 2026
  18. fengmk2
    added a commit that references this issue on Aug 30, 2026

    feat(env)!: replace Corepack with package manager shims (#2391)

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

Metadata

Metadata

Assignees

  • @fengmk2
    fengmk2

Labels

enhancementNew feature or request

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    • Beta

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.