!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

209 Members
60 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
13 Dec 2023
@hexa:lossy.networkhexasend a PR?19:04:37
@hexa:lossy.networkhexa * send the PR?19:04:41
@hexa:lossy.networkhexait's your change after all19:04:48
@lily:lily.flowersLily Foster
In reply to @hexa:lossy.network
it's your change after all
i mean, sure. give me a bit and i'll send it when i'm back at my laptop. i got a few other nodejs_20 fallout things i was gonna PR when i got back to my desk too
19:05:52
@hexa:lossy.networkhexadoes the builder provide python by itself?19:05:55
@lily:lily.flowersLily Foster
In reply to @hexa:lossy.network
does the builder provide python by itself?
it does now, yes
19:06:01
@hexa:lossy.networkhexaok, cool19:06:05
@hexa:lossy.networkhexalgtm19:06:07
@lily:lily.flowersLily Fosterand xcbuild on darwin19:06:09
@lily:lily.flowersLily Fostersince those were both in build closure already anyway and like they're both needed for basically any node-gyp packages19:06:34
@lily:lily.flowersLily Foster
In reply to @hexa:lossy.network
send the PR?
apologies for taking a bit. here's PR: https://github.com/NixOS/nixpkgs/pull/274063
20:43:07
15 Dec 2023
@avocadoom:avocadoom.deavocadoom joined the room.01:20:02
@avocadoom:avocadoom.deavocadoom

Hi, I currently try to package a Hugo site which uses BabelJS to transpile the JS to a more commonly compatible format. While having success with other Javascript frontend frameworks, I always get the following error while trying to build the site:

       last 10 log lines:
       > npm ERR! errno -1
       > npm ERR!
       > npm ERR! Your cache folder contains root-owned files, due to a bug in
       > npm ERR! previous versions of npm which has since been addressed.
       > npm ERR!
       > npm ERR! To permanently fix this problem, please run:
       > npm ERR!   sudo chown -R 30001:30000 "/var/empty/.npm"
       >
       > npm ERR! Log files were not written due to an error writing to the directory: /var/empty/.npm/_logs
       > npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

Note, that this does not happen when building in a nix shell. This is how my current flake looks like.

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  inputs.npmlock2nix = {
    url = "github:nix-community/npmlock2nix";
    flake = false;
  };

  outputs = { self, nixpkgs, npmlock2nix }:
    let
      supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
      forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
        pkgs = import nixpkgs {
          inherit system;

          overlays = [
            (self: super: {
              nodejs = super.nodejs-18_x;
              pnpm = super.nodePackages.pnpm;
              npmlock2nix = super.callPackage npmlock2nix { };
            })
          ];
        };
      });
    in
    {
      devShells = forEachSupportedSystem ({ pkgs }: {
        default = pkgs.mkShell {
          packages = with pkgs; [
            nodejs-18_x
            hugo
            curl
            html-proofer
            just
            nodePackages."@babel/cli"
          ];
        };
      });
      packages = forEachSupportedSystem ({ pkgs }: {
        default = pkgs.stdenv.mkDerivation rec {
          __noChroot = true;
          name = "darmstadt.ccc.de";
          src = ./.;

          nativeBuildInputs = [
            pkgs.hugo
            pkgs.nodejs
          ];

          buildPhase = ''
              export HOME=./
              npm install
              npm run build
          '';

          installPhase = ''
            mkdir -p $out/bin
            cp -r $src/downloads $out/
          '';
        };
      });
    };
}

Dont be bothered by some imports, they are just the result of some tests. The sources can be found here: https://git.darmstadt.ccc.de/cda/chaos-darmstadt.de/-/tree/nix-flakes

I really hop to find some suggestions here since I spent the whole evening googling for similar problems without success.

thx in advance :)

01:36:33
@avocadoom:avocadoom.deavocadoomFrom watching the build output, this problem occurs when executing the hugo build. This occurs installing the npm modules inside the buildscript as well as using npmlock2nix or buildNpmModule01:37:35
@lily:lily.flowersLily Foster
In reply to @avocadoom:avocadoom.de

Hi, I currently try to package a Hugo site which uses BabelJS to transpile the JS to a more commonly compatible format. While having success with other Javascript frontend frameworks, I always get the following error while trying to build the site:

       last 10 log lines:
       > npm ERR! errno -1
       > npm ERR!
       > npm ERR! Your cache folder contains root-owned files, due to a bug in
       > npm ERR! previous versions of npm which has since been addressed.
       > npm ERR!
       > npm ERR! To permanently fix this problem, please run:
       > npm ERR!   sudo chown -R 30001:30000 "/var/empty/.npm"
       >
       > npm ERR! Log files were not written due to an error writing to the directory: /var/empty/.npm/_logs
       > npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

Note, that this does not happen when building in a nix shell. This is how my current flake looks like.

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  inputs.npmlock2nix = {
    url = "github:nix-community/npmlock2nix";
    flake = false;
  };

  outputs = { self, nixpkgs, npmlock2nix }:
    let
      supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
      forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
        pkgs = import nixpkgs {
          inherit system;

          overlays = [
            (self: super: {
              nodejs = super.nodejs-18_x;
              pnpm = super.nodePackages.pnpm;
              npmlock2nix = super.callPackage npmlock2nix { };
            })
          ];
        };
      });
    in
    {
      devShells = forEachSupportedSystem ({ pkgs }: {
        default = pkgs.mkShell {
          packages = with pkgs; [
            nodejs-18_x
            hugo
            curl
            html-proofer
            just
            nodePackages."@babel/cli"
          ];
        };
      });
      packages = forEachSupportedSystem ({ pkgs }: {
        default = pkgs.stdenv.mkDerivation rec {
          __noChroot = true;
          name = "darmstadt.ccc.de";
          src = ./.;

          nativeBuildInputs = [
            pkgs.hugo
            pkgs.nodejs
          ];

          buildPhase = ''
              export HOME=./
              npm install
              npm run build
          '';

          installPhase = ''
            mkdir -p $out/bin
            cp -r $src/downloads $out/
          '';
        };
      });
    };
}

Dont be bothered by some imports, they are just the result of some tests. The sources can be found here: https://git.darmstadt.ccc.de/cda/chaos-darmstadt.de/-/tree/nix-flakes

I really hop to find some suggestions here since I spent the whole evening googling for similar problems without success.

thx in advance :)

that error isn't the real one. that is just npm trying to log the errors above it and failing to. can you share the whole build log?
01:39:12

Show newer messages


Back to Room ListRoom Version: 6