svanderburg / node2nix

Generate Nix expressions to build NPM packages
MIT License
526 stars 100 forks source link

some packages fail their postinstall due to missing opencollective #145

Open msteen opened 5 years ago

msteen commented 5 years ago

Due to node2nix 1.7.0 fixing #122 it becomes possible to generate the .nix files for https://github.com/bitwarden/web, but when trying to build the package afterwards with nix-build -A package, it fails on the following error:

> ngx-infinite-scroll@7.0.1 postinstall /nix/store/4wad5rffnq56mx5r366dn0jsmkx41gsc-node_bitwarden-web-2.10.1/lib/node_modules/bitwarden-web/node_modules/ngx-infinite-scroll
> opencollective postinstall

sh: opencollective: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! ngx-infinite-scroll@7.0.1 postinstall: `opencollective postinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the ngx-infinite-scroll@7.0.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /build/.npm/_logs/2019-06-05T22_58_27_141Z-debug.log
builder for '/nix/store/jgmc8c0nhbir2w9mb183l204axi8gv05-node_bitwarden-web-2.10.1.drv' failed with exit code 1
error: build of '/nix/store/jgmc8c0nhbir2w9mb183l204axi8gv05-node_bitwarden-web-2.10.1.drv' failed

The use of opencollective seems not unique to that particular nodejs package, but is more common among nodejs packages.

svanderburg commented 4 years ago

I haven't been able to answer this yet, but at first sight it might be fixable by adding a supplement JSON file that adds opencollective as a global dependency.

svanderburg commented 4 years ago

@msteen does adding the opencollective package as a supplement work for you?