!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

187 Members
55 Servers

Load older messages


SenderMessageTime
18 Sep 2025
@marie:marie.cologneMarie prisma-language-server would be my suggestion 09:05:51
@mmkaram:matrix.orgmmkaramhttps://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#:~:text=It%20should%20be%20identical%20to%20the%20upstream%20package%20name.09:06:20
@marie:marie.cologneMarieoh yeah thats not a hard requirement09:08:39
@mmkaram:matrix.orgmmkaramsweet09:08:58
@mmkaram:matrix.orgmmkaramwould anyone here happen to have encountered this error before: > npm error code ENOTCACHED > npm error request to https://registry.npmjs.org/universal-user-agent failed: cache mode is 'only-if-cached' but no cached response is available. > npm error A complete log of this run can be found in: /build/cache/_logs/2025-09-18T09_38_35_036Z-debug-0.log 09:39:19
@mmkaram:matrix.orgmmkaram

here is my package.nix as it is:

{
  lib,
  buildNpmPackage,
  fetchFromGitHub,
}:

buildNpmPackage (finalAttrs: {
  pname = "prisma-language-server";
  version = "6.16.2";

  src = fetchFromGitHub {
    owner = "prisma";
    repo = "language-tools";
    tag = "v${finalAttrs.version}";
    hash = "sha256-x4lYhS8PJ5paFJDAXGtKv0kY01C/YWaJU640WlJT8Eo=";
  };

  npmDepsHash = "sha256-QMxu2AWGRQ2semp6BmOQbM7Pw/pS0mgx0P0hr60SjPs=";

  # The prepack script runs the build script, which we'd rather do in the build phase.
  npmPackFlags = [ "--ignore-scripts" ];

  makeCacheWritable = true;

  NODE_OPTIONS = "--openssl-legacy-provider";

  meta = {
    description = "";
    homepage = "https://github.com/prisma/language-tools#readme";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ mmkaram ];
  };
})

09:39:35
@marie:marie.cologneMarieyes their lockfile is broken09:41:30
@marie:marie.cologneMariethats an issue which has been known for years now and npm doesn't consider it a bug09:41:51
@mmkaram:matrix.orgmmkaramexciting.09:42:07
@mmkaram:matrix.orgmmkaramwould maybe going to an older revision help?09:42:12
@mmkaram:matrix.orgmmkaramwhere the lockfile isn't broken09:42:16
@marie:marie.cologneMarieprobably not09:42:25
@marie:marie.cologneMarie you need to clone the repo, delete package-lock.json and run npm install --package-lock-only 09:42:56
@marie:marie.cologneMarieand use that one in your nix package09:43:02
@mmkaram:matrix.orgmmkaramokay will get on it09:43:14
@marie:marie.cologneMariethere should be examples of this in nixpkgs already09:43:20
@mmkaram:matrix.orgmmkaramexamples of what? using a different lockfile?09:43:38
@marie:marie.cologneMarieyes, providing your own lockfile09:43:47
@mmkaram:matrix.orgmmkaramah okay, would this parameter help at all: fetchNpmDeps?09:44:25
@marie:marie.cologneMariehttps://github.com/NixOS/nixpkgs/blob/10a275e22017a6c9bf3a38dbdcf504daa36f51c7/pkgs/by-name/in/intelephense/package.nix#L1909:44:37
@marie:marie.cologneMarie no, buildNpmPackage already uses that 09:44:58
@mmkaram:matrix.orgmmkaramahhh okay09:44:59
@mmkaram:matrix.orgmmkaramshould I put a comment or something explaing why I did that or is it implied09:45:11
@mmkaram:matrix.orgmmkaram* should I put a comment or something explaining why I did that or is it implied09:45:16
@marie:marie.cologneMariecomment is a good idea09:45:33
@mmkaram:matrix.orgmmkaramthank you for your help so far Marie!09:45:53
@mmkaram:matrix.orgmmkaram

I got the new package-lock.json but I'm still getting that error:

       > npm error code ENOTCACHED
       > npm error request to https://registry.npmjs.org/universal-user-agent failed: cache mode is 'only-if-cached' but no cached response is available.
       > npm error A complete log of this run can be found in: /build/cache/_logs/2025-09-18T10_22_07_289Z-debug-0.log
       >

with my package.nix:

{
  lib,
  buildNpmPackage,
  fetchFromGitHub,
}:

buildNpmPackage (finalAttrs: {
  pname = "prisma-language-server";
  version = "6.16.2";

  src = fetchFromGitHub {
    owner = "prisma";
    repo = "language-tools";
    tag = "${finalAttrs.version}";
    hash = "sha256-UZP0pLcbMeaYI0ytOJ68l/ZEC9dBhohJZyTU99p+1QM=";
  };

  npmPackFlags = [ "--ignore-scripts" ];
  makeCacheWritable = true;

  # The original lockfile from the upstream source is broken,
  # so we need to use a rebuilt version of the package-lock file.
  postPatch = ''
    cp ${./package-lock.json} package-lock.json
  '';

  npmDepsHash = "sha256-QMxu2AWGRQ2semp6BmOQbM7Pw/pS0mgx0P0hr60SjPs=";

  NODE_OPTIONS = "--openssl-legacy-provider";

  meta = {
    description = "";
    homepage = "https://github.com/prisma/language-tools#readme";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ mmkaram ];
  };
})

10:23:07
@marie:marie.cologneMarie did you update npmDepsHash? 10:38:01
@mmkaram:matrix.orgmmkaramyep10:38:57
@marie:marie.cologneMarie but it's the same as here, no? 10:39:45

Show newer messages


Back to Room ListRoom Version: 6