Skip to content

Prompt users whether to reinstall a package installed by a different node version in vp update -g #1598

Closed

Description

@liangmiQwQ

When I made up #1477, I actually thought about a question: should we reinstall the packages installed with a different node version.

For example, you installed oxlint globally with node v21.0.0, but now you are running vp update -g with node v25.0.0.

The reason why I have this question is different nodes can have different installing behaviors, like engine.node compatibility checks or some post-install scripts.

Originally posted by @liangmiQwQ in #1596 (review)

Activity

  1. changed the title [-]Should Vite+ re-install packages installed by a different node version?[/-] [+]Should Vite+ re-install global packages installed by a different node version?[/+] on May 16, 2026
  2. fengmk2 commented on May 17, 2026

    @fengmk2
    Member

    From a user experience-first perspective, I believe maintaining the current logic and using the user's current Node version for installation is more aligned with expectations. This way, it's consistent with the Node.js version that users perceive when directly using the npm update -g <pkg> command.

    @cpojer WDYT?

  3. liangmiQwQ commented on May 17, 2026

    @liangmiQwQ
    CollaboratorAuthor

    I agree on using user's current Node version. Though this problem is worth disucssing, it seems that there are some misunderstandings, I'm sorry I didn't explain clearly in the issue.

    I original meant that as #1596 added skipping logic for up-to-date packages, we should also think about whether Vite+ should skip updating packages installed by a different Node version from the current.

    As the example above, you installed oxlint@1.65.0 globally with node v21.0.0, but now you are running vp update -g with node v25.0.0, while the oxlint's latest version is sitll 1.65.0, should we skip updating them, or should we still use v21.0.0's node to install them in the future?

    My personal idea is deciding on the package's engines.node, even if a package is up to data, Vite+ can still reinstall it if it is installed by an incompatible node while the current Vite+ use a compatible node to update, or a package which is installed by a compatible node but be updated with an incompatible node.

  4. fengmk2 commented on May 18, 2026

    @fengmk2
    Member

    Or add a user confirmation prompt? If the package version hasn't changed, but the Node.js version has changed, should we prompt the user whether they need to upgrade?

  5. cpojer commented on May 18, 2026

    @cpojer
    Member

    Prompting and communicating with the user here makes the most sense, regardless of which solution you are choosing.

  6. changed the title [-]Should Vite+ re-install global packages installed by a different node version?[/-] [+]Prompt users whether to reinstall a package installed by a different node version in `vp update -g`[/+] on May 18, 2026
  7. liangmiQwQ commented on May 18, 2026

    @liangmiQwQ
    CollaboratorAuthor

    Thanks, the title is updated to fit the new task scope.

    By the way, considering vp update can include multiple packages which need updating with a different Node.js version, will it be annoying if we prompt users for every single package? Showing only one prompt for all packages seems better but also less exact. What do you think of it?

  8. added this to the Beta milestone on May 21, 2026
  9. added a commit that references this issue on May 30, 2026
    df444c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions