node2nix
node2nix copied to clipboard
Failing to install package using generated default.nix, missing node js-8_x
I am trying to install the hyperdrive-daemon npm package.
$ cat .node-packages.json
[
"hyperdrive-daemon"
]
$ node2nix -i .node-packages.json
[..]
$ nix-env --show-trace -f default.nix -iA hyperdrive-daemon
installing 'node_hyperdrive-daemon-1.13.14'
error: while evaluating the attribute 'buildInputs' of the derivation 'node_hyperdrive-daemon-1.13.14' at /home/drpyser/node-env.nix:397:7:
while evaluating 'getOutput' at /nix/store/8hf8j587shqyhiy2by79hz21ay38q61w-nixos-19.09.2211.815dd784b65/nixos/lib/attrsets.nix:464:23, called from undefined position:
while evaluating anonymous function at /nix/store/8hf8j587shqyhiy2by79hz21ay38q61w-nixos-19.09.2211.815dd784b65/nixos/pkgs/stdenv/generic/make-derivation.nix:142:17, called from undefined position:
attribute 'nodejs-8_x' missing, at /home/drpyser/default.nix:5:48
I'm a nix noob, so I'm probably missing something.
@DrPyser Node.js 8.x has reached end-of-life and was removed from recent versions of Nixpkgs.
You can still use it by switching to an older version of Nixpkgs, such as Nixpkgs version 19.03
Alternatively, use the generator to generate expressions for newer versions of Node.js. For example, with the following command you can generate expressions for Node.js 12.x:
node2nix --nodejs-12 -i .node-packages.json
You should probably also upgrade node2nix to a newer version. In the latest stable release, the default Node.js version is 12.x