Change:
switch between Nodes. You can install npm package binaries in your toolchain without having to periodically reinstall them or figure out why they’ve stopped working. <ins> Note: Volta cannot be used on NixOS out of the box because it downloads Node binaries that assume shared libraries are in FHS standard locations. </ins> ''; homepage = "https://volta.sh/"; changelog = "https://github.com/volta-cli/volta/blob/main/RELEASES.md";

Discussion:
I'm trying to use nodejs/yarn/npm through volta (see ), with home manager. After setting the VOLTA_HOME variable, running and bit of fiddling trying to make it work I get an error . Looking into the logs it seems the library is not installed at runtime, but not sure if that's the issue Steps to reproduce the behavior: package --version node --version volta installed node version ! ! ! Add any other context about the problem here. <!-- Please @ people who are in the list of the offending package or module. If in doubt, check for whoever last touched something. --package by Please run and paste the result.
I also tried using nixos-unstable and installing volta at system level, to no avail: <details<summarycat </summary<pre"node" "--version" Volta v1.1.1 Node is not available. To run any Node command, first set a default version using Error cause: No such file or directory (os error 2) </pre</details
was able to fix the issue by using
I'll take a look on my NixOS machine later. Possibly just needs that runtime dep on NixOS, I was only able to test this on my Darwin machine when I submitted it.
I can reproduce this on my NixOS machine, obviously. The problem is that Volta downloads the binaries so there's no good way for us to patch them. I don't know how to fix this but one idea I have is to use to wrap the shim that Volta creates. Would it work if we replace the binary here with so that executes the in an environment that has available?
That looks good to me but I'm also not very experienced with nix.
I can't get this to work and I don't know what else I can try. First of all, the binary detects if it's called through a symlink or not and if not, it exits with an error. Next, after installing , when you run it will create symlinks in so that all binaries (, ...) point at . This also makes this issue harder to solve, because even if you manage to successfully wrap some command so that the missing library is discoverable at runtime, Volta will link to the original, unwrapped binaries.

I assume that this is the reason why they mention in their documentation that all volta binaries need to be in the same folder. So they can link to them relatively to where the binary lives. Lastly, I always struggle with this dynamic linking business. Long story short, I don't think I can fix this issue. I therefore believe it might be better to mark this as not supported or broken on NixOS
yeah, the nix-ld solution works for me, it was just hard to figure it out. It should be pointed out somewhere, in the package description or perhaps the nixos wiki
Sorry for opening this up again, but what were the steps you needed to take with nix-ld? Currently trying to figure out how to make volta work as well and I can't seem to find a lot of resources on this.
I these 2 variables to the session environment with home manager: I'll try to find a source for this.