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 — `npm` shim does not consult `packageManager` field · Issue #1629 · voidzero-dev/vite-plus

npm shim does not consult packageManager field #1629

New issue
Copy link
New issue
Copy link
Closed
Feature
#1654
Closed
npm shim does not consult packageManager field#1629
Feature
#1654
Copy link
Assignees
fengmk2
Labels
enhancementNew feature or request
Milestone
Beta

Description

@bouzlibop
bouzlibop
opened on May 19, 2026
Issue body actions

Describe the bug

npm shim (running $HOME/.vite-plus/bin/npm) does not consult packageManager field. This is confusing. While node --version will properly print the version, which respect .node-version. npm --version will use resolved Node.js npm version not the one specified in packageManager field.

Steps to reproduce

  1. Install [email protected]: npm i -g [email protected].
  2. Set packageManager field to [email protected]: npm pkg set [email protected]
  3. Run vp install -- --verbose and then npm --version.

Expected:
Both commands should respect packageManager field. They both should print 11.14.0.

Actual:
vp install -- --verbose prints npm info using [email protected], which is expected, but npm --version print 11.14.1, which is confusing.

System Info

`vp v0.1.21`

`which npm` is `$HOME/.vite-plus/bin/npm`

Used Package Manager

npm

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 Adrian-Baran-GY

Activity

  1. bouzlibop
    added the
    Bug
    issue type on May 19, 2026
  2. bouzlibop
    added
    pending triage
    on May 19, 2026
  3. fengmk2 commented on May 20, 2026

    @fengmk2
    fengmk2
    on May 20, 2026
    Member
    More actions

    Currently, we will not change npm's version selection logic. Only when running package manager-related commands with vp will the packageManager config be followed.

  4. bouzlibop commented on May 20, 2026

    @bouzlibop
    bouzlibop
    on May 20, 2026
    Author
    More actions

    Could you explain a bit more? What's confusing to me is that node --version properly reports the version resolved for a given project. Why then npm --version works differently instead of also giving project specific results?

  5. bouzlibop commented on May 20, 2026

    @bouzlibop
    bouzlibop
    on May 20, 2026
    Author
    More actions

    Also, the output of vp env current does not report npm version:

    Vite+ - The Unified Toolchain for the Web
    
    Environment
      Version   22.22.0
      Source    devEngines.runtime
      Source Path   $HOME/src/myapp/package.json
      Project Root   $HOME/src/myapp
    
    Tool Paths:
      node  $HOME/.vite-plus/js_runtime/node/22.22.0/bin/node
      npm  $HOME/.vite-plus/js_runtime/node/22.22.0/bin/npm
      npx  $HOME/.vite-plus/js_runtime/node/22.22.0/bin/npx
    

    In order to check what is the resolved npm version which vp will use in a given project I did vp install -- --version, which feels more like a hack than a proper approach. Is there a better way?

    It would be helpful if we could print the resolved package manager, its version, source and source path similarly to Node info we have in the Environment part. Then it would be clear which package manger vp sees and why.

  6. fengmk2 commented on May 21, 2026

    @fengmk2
    fengmk2
    on May 21, 2026
    Member
    More actions

    @cpojer What do you think? Should we make npm/pnpm/yarn handle it similarly to node's lookup logic? Prioritize using the configuration version of the current project, and fall back to the global version only if not found?

  7. fengmk2
    assigned
    cpojer
    on May 21, 2026
  8. cpojer commented on May 21, 2026

    @cpojer
    cpojer
    on May 21, 2026
    Member
    More actions

    Yes I think we should if packageManager explicitly declares npm@<version>. If the project is configured with pnpm /yarn/bun, it should not turn an npm install into a pnpm install.

  9. fengmk2 commented on May 21, 2026

    @fengmk2
    fengmk2
    on May 21, 2026
    Member
    More actions

    Okay, I will refer to the version lookup logic of node. npm/pnpm/yarn shims will run the correct version based on the packageManager field.

    Reacted by Adrian-Baran-GY
  10. fengmk2
    assigned
    fengmk2
    and unassigned
    cpojer
    on May 21, 2026
  11. fengmk2
    added
    enhancementNew feature or request
    on May 21, 2026
  12. fengmk2
    changed the issue type from
    Bug
    to
    Feature
    on May 21, 2026
  13. fengmk2
    added this to the Beta milestone on May 21, 2026
  14. fengmk2
    removed
    pending triage
    on May 21, 2026
  15. fengmk2
    linked a pull request that will close this issuefeat: respect packageManager in package manager shims #1654on May 21, 2026
  16. fengmk2
    closed this as completedin #1654on May 22, 2026
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

Feature

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

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.