tuxedo-control-center: fix: pin nodejs version

Pins the nodejs version used for building/running Tuxedo Control Center
to the same version used for updating (i.e. by node2nix).
This prevents build errors due to package.json format differences
between nodejs versions, such as the following:

  > npm WARN old lockfile }
  > npm ERR! code ENOTCACHEDill idealTree buildDepDep
  > npm ERR! request to https://registry.npmjs.org/@angular-devkit%2fbuild-angular failed: cache mode is 'only-if-cached' but no cached response is available.
This commit is contained in:
Florian Warzecha
2022-12-09 23:58:15 +01:00
parent 12bb6c354f
commit adc8176c4e
2 changed files with 10 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{ pkgs, lib, stdenv, copyDesktopItems
, python3, udev
, makeWrapper, nodejs, electron_11, fetchFromGitHub
, makeWrapper, nodejs-14_x, electron_11, fetchFromGitHub
}:
let
@@ -12,6 +12,13 @@ let
# 3. Build and test.
version = "1.1.3";
# keep in sync with update.sh!
# otherwise the format of package.json does not mach the format used by the
# version used by nixpkgs, leading to errors such as:
# > npm ERR! code ENOTCACHED
# > npm ERR! request to https://registry.npmjs.org/node-ble failed: cache mode is 'only-if-cached' but no cached response is available.
nodejs = nodejs-14_x;
baseNodePackages = (import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;

View File

@@ -24,6 +24,8 @@ for f in package.json package-lock.json; do
curl -f "$TUXEDO_SRC_URL/$f" > "$WORKDIR/$f"
done
# keep the nodejs switch in sync with the nodejs alias at the top of default.nix!
# (see the alias there for an explanation)
node2nix \
--development \
--nodejs-14 \