Node.js: Difference between revisions
imported>Mightyiam Example nix shell for Node.js development |
imported>Tennox Add example how to build nodePackages with different nodejs version - see https://discourse.nixos.org/t/how-to-use-pnpm-with-recent-nodejs/21867/4?u=tennox |
||
Line 177: | Line 177: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Using nodePackages with a different node version == | |||
Packages in {{ic|nixpkgs.nodePackages}} are built using {{ic|nixpkgs.nodejs}}, so if you [[Overlays|overlay that package]] to a different version, the {{ic|nodePackages}} will be built using that: | |||
<syntaxhighlight lang="nix> | |||
final: prev: { | |||
nodejs = prev.nodejs-16_x; | |||
} | |||
</syntaxhighlight> | |||
<pre> | |||
$ pnpm node --version | |||
v16.17.1 | |||
</pre> | |||
== External Links == | == External Links == |