-
Notifications
You must be signed in to change notification settings - Fork 100
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
node-gyp-build: /usr/bin/env: bad interpreter: No such file or directory #275
Comments
This was a really tricky package! As the discourse item describes, you should create an override so that However, what I noticed is that as soon as this dependency is provided, it still attempts to invoke I ended up implementing an {pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem}:
let
nodePackages = import ./default.nix {
inherit pkgs system;
};
in
nodePackages // {
hypercore = nodePackages.hypercore.override {
buildInputs = [ pkgs.nodePackages.node-gyp-build ];
preRebuild = ''
sed -i -e "s|#!/usr/bin/env node|#! ${pkgs.nodejs}/bin/node|" node_modules/node-gyp-build/bin.js
'';
};
} with the following command I was able to build it: $ nix-build -A hypercore I think the most annoying part is the Fortunately, I manual |
https://github.com/NixOS/nixpkgs/blob/e95ee1fb3697b67268b0076abc6d74b2d8de6f2a/pkgs/build-support/setup-hooks/patch-shebangs.sh#L51 |
Great Find! Explains why it's not patching those files, can this behaviour be changed, especially in nodejs is being naughty and not marking scripts with an executable bit. I wonder what other horrible behaviour it has. |
couple ideas i have: |
It would be nice if Nixpkgs' I can also image that other packages in Nixpkgs, i.e. non-NPM packages, could run into the similar problems. |
@svanderburg for some reason your suggested fix doesn't work for me (nor do these instructions). Specifically, the The following repo contains the source files ( |
something has either changed in nixpkgs or npm , and things that built are no longer building (such is life).
you can recreate it with the hypercore package here
NixOS/nixpkgs#142196
I'm working on another repo which reports when building with node2nix. :-( . https://discourse.nixos.org/t/nodejs-application-in-nix/16196
I think the interesting thing here, they are both failing with the same 'bad interpreter' , may be a clue, or may be a red herring.
'in npm space, no one can hear you scream'
The text was updated successfully, but these errors were encountered: