!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

199 Members
57 Servers

Load older messages


SenderMessageTime
31 Jan 2024
@federicodschonborn:matrix.orgFederico Damiรกn Schonborn changed their profile picture.06:21:18
1 Feb 2024
@hexa:lossy.networkhexahttps://github.com/NixOS/nixpkgs/issues/27769715:02:30
@hexa:lossy.networkhexarip15:02:30
@hexa:lossy.networkhexaapparently we are already on 4.2.4, so no idea ๐Ÿ˜„ 15:06:33
@lily:lily.flowersLily Foster
In reply to @hexa:lossy.network
apparently we are already on 4.2.4, so no idea ๐Ÿ˜„
4.2 branch is still v1 lockfile, even 4.2.5
17:13:46
@hexa:lossy.networkhexayeah, no idea17:14:06
@hexa:lossy.networkhexafound this on the fediverse17:14:15
@lily:lily.flowersLily Fosterit will need to be fixed before 4.3 or something, presumably17:14:44
2 Feb 2024
@keiichi:matrix.orgteto

Is it expected for npm link to fail ? from a nix develop with buildNpmPackage

โžœ npm link package.json 
npm ERR! code ENOENT
npm ERR! syscall mkdir
npm ERR! path /nix/store/d6lkbndr98lcn8spbqxfq52f2ldvqhks-nodejs-20.11.0/lib/node_modules/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, mkdir '/nix/store/d6lkbndr98lcn8spbqxfq52f2ldvqhks-nodejs-20.11.0/lib/node_modules/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
12:59:02
@lily:lily.flowersLily Foster
In reply to @keiichi:matrix.org

Is it expected for npm link to fail ? from a nix develop with buildNpmPackage

โžœ npm link package.json 
npm ERR! code ENOENT
npm ERR! syscall mkdir
npm ERR! path /nix/store/d6lkbndr98lcn8spbqxfq52f2ldvqhks-nodejs-20.11.0/lib/node_modules/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, mkdir '/nix/store/d6lkbndr98lcn8spbqxfq52f2ldvqhks-nodejs-20.11.0/lib/node_modules/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
i just looked it up to double check, but npm link operates on the global prefix apparently (i.e. the dir node is "installed" to) so yeah without changing the prefix via npm config, it's not gonna do anything useful from nix
13:05:51
@lily:lily.flowersLily Foster(regardless of being in a dev shell, i imagine)13:06:07
@keiichi:matrix.orgtetoit seemed like it but I preferred to be sure ty13:06:59
5 Feb 2024
@ThorHop:matrix.org@ThorHop:matrix.org removed their profile picture.22:45:11
@ThorHop:matrix.org@ThorHop:matrix.org removed their display name IdeallyYes.22:46:21
@ThorHop:matrix.org@ThorHop:matrix.org left the room.22:46:57
6 Feb 2024
@tensor5:matrix.orgNicola Squartini Hi, I'm trying to put a flake.nix in a NextJS project, that contains a very basic packages.default output with buildNpmPackage 10:41:30
@tensor5:matrix.orgNicola Squartini the problem is that whenever I use a revative import to a local .ts file I get error Module not found: Can't resolve './<file name>' 10:43:36
@tensor5:matrix.orgNicola Squartini although npm run build work normally when I run it from the shell 10:44:29
@tensor5:matrix.orgNicola Squartini to reproduce you can create a Next project with npx create-next-app@latest and accept the defaults 10:46:50
@tensor5:matrix.orgNicola Squartiniand then add an import to a local file10:47:19
@9hp71n:matrix.orgghpzin Did you git add that file ? 10:49:59
@tensor5:matrix.orgNicola Squartini

yes, here is the flake:

{
  description = "Blog";

  inputs = {
    flake-utils.url = "github:numtide/flake-utils";
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  };

  outputs = { flake-utils, nixpkgs, self }:
    flake-utils.lib.eachDefaultSystem (system:
      let pkgs = import nixpkgs { inherit system; }; in
      {
        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            nodejs_21
            prefetch-npm-deps
          ];
        };
        formatter = pkgs.nixpkgs-fmt;
        packages.default =
          let
            packageJson = builtins.fromJSON (builtins.readFile ./package.json);
          in
          pkgs.buildNpmPackage {
            pname = packageJson.name;
            version = packageJson.version;
            npmDepsHash = "sha256-gjQCVQI7Tp+L6ZF9phJFZQaaPwtPDp0xVOYMF+CPHIg=";

            src = ./.;

            BUILD_ID = self.rev or self.dirtyRev;
            NEXT_TELEMETRY_DISABLED = 1;

            #installPhase = ''
            #  runHook preInstall
            #  cp -r out $out
            #  runHook postInstall
            #'';
          };
      }
    );
}
10:50:29
@tensor5:matrix.orgNicola Squartininix build works as long as I don't add local imports10:51:02
@tensor5:matrix.orgNicola Squartiniimports from node_modules don't have issues10:51:38
@tensor5:matrix.orgNicola Squartini
In reply to @9hp71n:matrix.org
Did you git add that file ?
ahh, you are right! I actually forgot to add that fiel
10:54:29
@tensor5:matrix.orgNicola Squartinisorry about that10:55:04
@tensor5:matrix.orgNicola Squartinithank you so much ๐Ÿ™10:56:39
8 Feb 2024
@adis:blad.is@adis:blad.is Is there any rationale for keeeping buildNpmPackage around anymore?
Imo it should be dropped in favour of just using stdenv.mkDerivation
01:26:21
@kranzes:matrix.org@kranzes:matrix.orgExplain 03:12:07
@kranzes:matrix.org@kranzes:matrix.orgIs this because of npmHooks?03:12:36

Show newer messages


Back to Room ListRoom Version: 6