nodePackages_8_x: Add nodejs (npm) to wrapper

Some pnpm commands forward to npm which might not exist in $PATH
This commit is contained in:
adisbladis 2018-06-06 15:53:27 +08:00
parent 832973d179
commit 0b97cb69f3
No known key found for this signature in database
GPG Key ID: ED58F95069B004F5
1 changed files with 7 additions and 2 deletions

View File

@ -68,9 +68,14 @@ nodePackages // {
pnpm = nodePackages.pnpm.override (oldAttrs: {
nativeBuildInputs = oldAttrs.buildInputs ++ [ pkgs.makeWrapper ];
postInstall = ''
postInstall = let
pnpmLibPath = stdenv.lib.makeBinPath [
nodejs.passthru.python
nodejs
];
in ''
for prog in $out/bin/*; do
wrapProgram "$prog" --prefix PATH : ${stdenv.lib.makeBinPath [ nodejs.passthru.python ]}
wrapProgram "$prog" --prefix PATH : ${pnpmLibPath}
done
'';
});