Skip to content

[Bug] "yarn node" command sometimes uses wrong node.exe on Windows #1377

Closed
@a-sore

Description

@a-sore

yarn node sometimes doesn't resolve node.exe to the one Yarn was started with. This has only happened on Windows.

To Reproduce

  • Create any new yarn 2 project on Windows.
  • Run yarn node using a predefined path to node.exe and Yarn: e.g. ..\path-to-node\node.exe ..\path-to-yarn\yarn-berry.js node
  • If the supplied node.exe is not in the current directory, Yarn will use the first node.exe found in the user's PATH, instead of the one invoked by the user.

This means only this works properly: .\node.exe ..\path-to-yarn\yarn-berry.js node ...

This doesn't (uses node.exe from PATH): ..\any-other-path\node.exe ..\path-to-yarn\yarn-berry.js node ...

Environment

  • OS: Windows 10
  • Node version: irrelevant
  • Yarn version: 2.0.0-rc.30

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions