4 ms·
> The external dependency problem is somewhat solved in npm (at least, as far as many users are concerned) by writing a module that downloads the appropriate bi
by ParetoOptimal 4y ago
> The external dependency problem is somewhat solved in npm (at least, as far as many users are concerned) by writing a module that downloads the appropriate binary.
This complicates working on node projects with nix in my experience.
Is there a way to tell npm "no, just use my binary"?
Best i've found is letting npm download it and then overwriting the npm binary with the nix one in a postinstall script.
Why you ask? Npm doesn't always have an aarch64 or arm32 binary.
Nix being a source based package manager typically does support it or at least makes it possible by overriding build/configure options.
- skybrian 4y agoIf you know how to build the binary from scratch, could you teach the npm package's continuous build to do it? Sending a pull request fixing the npm package would fix it for everyone, not just nix users. Also, I wonder if nix would be a suitable tool for generating npm packages that contain binaries? Maybe this is a way for people to benefit from nix without actually using it.
- rgoulter 4y ago> If you know how to build the binary from scratch, could you teach the npm package's continuous build to do it? Sending a pull request fixing the npm package would fix it for everyone, not just nix users. The "I have a binary already, just use this one" is in response to the problems NixOS users face dealing with helpful software like this. NixOS doesn't provide shared libraries in the standard locations (for good reasons). Binaries that tools like NPM download will link against shared libraries in the standard location. It's not really a question of "providing the binaries would help", because it's about assumptions of where the shared libraries are.