Skip to content

useNodeVersion should ensure cmds installed in node_modules/.bin use the provided node version #9661

Description

@hanikesn

Contribution

Describe the user story

We switched to useNodeVersion to manage our node version, but many developers still have npx $cmd deeply ingrained in their muscle memory. This will make those cmds use the node version on $PATH instead of the one installed by pnpm.

It's hard to retrain users thoroughly and mildly annoying to add our own workaround. So it'd be nice for pnpm to ensure all cmds always use the specified node version.

Describe the solution you'd like

Looking at the generated scripts from cmd-shim it seems the obvious choice would be to either add a node symlink in the node_modules directory or adjust the script to just always use pnpm's node.

Describe the drawbacks of your solution

There might be issues with backwards compatibility, which could be mitigate by making this strict behavior opt-in.

Describe alternatives you've considered

Other users encountered the same issue:

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions