It appears that the libpng package has multiple outputs, one of which is the dev build. On my macOS machine:
brocking@station1:~/dev > nix-env -qasA nixpkgs.libpng.dev
There's a chapter in the manual for the
nixpkgs collection that covers this. IIRC the nixpkgs collection has included multiple outputs for the last few major releases and I believe that many packages are built in this manner now.
PS there's also a section in the nixpkgs manual that covers node.js packages which is probably worth taking a look at also.
I've had a quick look at the GitHub issue that you've opened and you definitely seem to be on the right track, but unfortunately I am not familiar enough with either node.js or
node2nix to be able to see exactly what the problem is.
However, one general point I can make though is that whenever you are trying to package something with Nix and you get an error such as you've experienced below then it almost always means that either or both 1. you need to tell nix how it can get hold of a dependency (
libpng-dev in this case) and 2. you need to make sure that the nix expression that you are trying to build somehow includes a reference to 1. (often that is via a
buildInputs nix attribute, although that depends very much what build system you are using), in your case I am guessing that it might be as an argument to the
pngquant expression in the
default.nix file generated by
node2nix, although as I said it is quite unfamiliar for me so I may be quite wrong about that.
ℹ compiling from source
✔ pngquant pre-build test passed successfully
✖ RequestError: pngquant failed to build, make sure that libpng-dev is installed
You may find some more and faster help in the chat on the #nixos IRC channel, people on there are very helpful and I have found a lot of knowledge on there previously.
One last remark, the great strength of Nix is its purity - you have to tell it exactly where to find everything, and that can be a little daunting at first. However once you get your head around that then the purity is something you can really appreciate.