From 8687b48a37dbf54e79f1092dbda2d2ef6c8b2330 Mon Sep 17 00:00:00 2001 From: Zhenya Vinogradov Date: Tue, 3 Dec 2019 15:40:56 +0300 Subject: [PATCH] [OPS-900] Fix mkNodeModules for npm 6.11.3 --- default.nix | 6 +++++- nix/sources.json | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 9d4279a..e0828a0 100644 --- a/default.nix +++ b/default.nix @@ -76,7 +76,11 @@ with stdenv.lib; let yarnAlias = ''yarn() { ${yarnCmd} $yarnFlags "$@"; }''; npmFlagsYarn = [ "--offline" "--script-shell=${shellWrap}/bin/npm-shell-wrap.sh" ]; - npmFlagsNpm = [ "--cache=./npm-cache" "--nodedir=${_nodejs}" ] ++ npmFlagsYarn; + npmFlagsNpm = [ + # `npm ci` treats cache parameter differently since npm 6.11.3: + "--cache=${if versionAtLeast _nodejs.version "10.17.0" then "./npm-cache/_cacache" else "./npm-cache"}" + "--nodedir=${_nodejs}" + ] ++ npmFlagsYarn; commonEnv = { XDG_CONFIG_DIRS = "."; diff --git a/nix/sources.json b/nix/sources.json index 54f7eed..73d1af8 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "a36b2925a5082e821ad80b3a7bfedcc6e488b91c", - "sha256": "14sx173cg1g1lpd5hcarxxz8n78jsffr6pv9l05a58aq0ilgk328", + "rev": "93223f5cc35ccee76d000bb1a18781d35b99878b", + "sha256": "0a52g32w9rxkdq81avzbx8vy8bdbxzkbh41qg8mdxl7wb9qcqv9v", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a36b2925a5082e821ad80b3a7bfedcc6e488b91c.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/93223f5cc35ccee76d000bb1a18781d35b99878b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } }