-
Notifications
You must be signed in to change notification settings - Fork 233
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
nested volta invocations #702
Comments
We've run into this with a |
@chriseppstein Can you talk more about the use-case of one JS project calling a tool that is managed by Volta in another project directory? Specifically how you would expect it to work, and how it currently works in a system without Volta? We have issue #492 as a potential solution to a whole class of issues relating to global tools interacting with each other, which may be a solution, though in the initial brainstorm it would still result in only a single version of Node. @toshok That's an interesting case, can you expand on it? Does it fail, or is it that it uses an unexpected version of Node? |
@charlespierce In my situation, the tool isn't being distributed as a published executable. You checkout the code, I think #492 is a good idea, but I don't think that it will address the issue I'm seeing -- I want a spawned process to "start fresh", if there's I expect that most people would want spawned processes to inherit the pinned volta versions even if executed outside of their package directory. The question I have is whether volta should leave the shims in the first |
@chriseppstein Short term, since you control the code that's launching these other tools, I think that your workaround makes sense to "reset" the environment so Volta starts fresh. Longer term something like #492 may also provide the behavior you need. However, there are a lot of unanswered questions (several of which you note) about what the most common expected behavior will be, which is why we have that issue marked as "Needs RFC". We'll need to hash out the possible flows and determine what makes the most sense for the majority of use-cases. |
@toshok I see the code in |
re: our problem, it fails to respawn with ENOENT:
|
@toshok It's a super small fix, so I just submitted a PR (and associated issue) to |
@toshok That change landed and was published, so @chriseppstein Closing in favor of #492 as the overall approach to fixing tools interacting with other tools. |
@nhhockeyplayer Can you clarify your question? Where is that error log from? Volta doesn't have any direct association with NX or GitHub Actions (other than that we publish our own GitHub Action that you can use in your own workflows). Volta itself is a tool for managing Node versions. The above error message seems to be from a command that is attempting to run a Volta command without having Volta installed. |
When code in a javascript project that uses volta tries to execute a volta-controlled binary in another javascript project that also uses volta, the behavior is not what one would expect. The
PATH
environment variable will be set to the binary versions that the first-invoked project uses.Here's some typescript code that I wrote to work around this issue:
I'm curious whether this sort of workaround is expected for these situations? If so, does the code I've written here look reasonable?
The text was updated successfully, but these errors were encountered: