Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn is running with the wrong version of Node #146

Closed
mikrostew opened this issue Sep 13, 2018 · 0 comments · Fixed by #153
Closed

Yarn is running with the wrong version of Node #146

mikrostew opened this issue Sep 13, 2018 · 0 comments · Fixed by #153
Labels

Comments

@mikrostew
Copy link
Contributor

Repro

Remove your system node (or rename the binary).

In a project, setup the toolchain:

$ notion use node 10
$ notion use yarn 1.7
$ cat package.json | jq '.toolchain'
{
  "node": "10.10.0",
  "yarn": "1.7.0"
}

Running node works, but yarn fails:

$ node --version
v10.10.0
$ yarn --version
Yarn requires Node.js 4.0 or higher to be installed.

Cause

When the yarn shim runs, it sets the PATH wtih env::path_for_installed_node(), which strips out the Notion bin directory . When the actual yarn script is run with that PATH, it looks for node. But it doesn't see the Notion node shim, because it is not on the PATH. So it uses whatever is on the PATH, which is the system node, or nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant