Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn2nix "Couldn't find any versions that matches in our cache" #190681

Closed
GuillaumeDesforges opened this issue Sep 10, 2022 · 1 comment
Closed

Comments

@GuillaumeDesforges
Copy link
Contributor

Describe the bug

I'm trying to package marp-cli with yarn2nix: https://github.com/marp-team/marp-cli

However build complains with

error: builder for '/nix/store/9af4bw297961rx7wc8a2yyzap2fqn0wh-marp-team-marp-cli-modules-2.1.4.drv' failed with exit code 1;
       last 10 log lines:
       > warning Lockfile has incorrect entry for "pug-runtime@^2.0.4". Ignoring it.
       > error Couldn't find any versions for "pug" that matches "^2.0.3" in our cache (possible versions are ""). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.
       > info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
       > Error: Couldn't find any versions for "pug-runtime" that matches "^2.0.4" in our cache (possible versions are ""). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.
       >     at MessageError.ExtendableBuiltin (/nix/store/8lajm4glg9v9f7lzpz4r4gm02rqwgnkl-yarn-1.22.18/libexec/yarn/lib/cli.js:721:66)
       >     at new MessageError (/nix/store/8lajm4glg9v9f7lzpz4r4gm02rqwgnkl-yarn-1.22.18/libexec/yarn/lib/cli.js:750:123)
       >     at NpmResolver.<anonymous> (/nix/store/8lajm4glg9v9f7lzpz4r4gm02rqwgnkl-yarn-1.22.18/libexec/yarn/lib/cli.js:50430:15)
       >     at Generator.next (<anonymous>)
       >     at step (/nix/store/8lajm4glg9v9f7lzpz4r4gm02rqwgnkl-yarn-1.22.18/libexec/yarn/lib/cli.js:310:30)
       >     at /nix/store/8lajm4glg9v9f7lzpz4r4gm02rqwgnkl-yarn-1.22.18/libexec/yarn/lib/cli.js:321:13
       For full logs, run 'nix log /nix/store/9af4bw297961rx7wc8a2yyzap2fqn0wh-marp-team-marp-cli-modules-2.1.4.drv'.
error: 1 dependencies of derivation '/nix/store/9lxxd3250h492b4s2lvxcf53ral42mcn-marp-cli.drv' failed to build

Steps To Reproduce

{
  nixConfig.bash-prompt-prefix = "(nix) ";

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

  outputs = { nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let pkgs = nixpkgs.legacyPackages.${system};
      in
      {
        packages.default = pkgs.mkYarnPackage {
          name = "marp-cli";
          version = "2.1.4";
          src = pkgs.fetchFromGitHub {
            owner = "marp-team";
            repo = "marp-cli";
            rev = "v2.1.4";
            sha256 = "TkjaCiKrorYF8Ml8Xps3xZxcN5ePTpv2Jw1c2Icqtm8=";
          };
        };
      }
    );
}

Expected behavior

It should build.

Additional context

Discourse post: https://discourse.nixos.org/t/mkyarnpackage-lockfile-has-incorrect-entry/21586

It seems that it could be related to pugjs being a monorepo using yarn workspaces: https://github.com/pugjs/pug

Notify maintainers

Latest contributors: @SuperSandro2000 @sumnerevans @roberth

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.43, NixOS, 22.11 (Raccoon), 22.11.20220608.04dcb53`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.9.0pre20220530_af23d38`
 - channels(theo): `"home-manager"`
 - channels(root): `"nixos-21.11pre319271.31ffc50c571"`
 - channels(arsleust): `"home-manager"`
 - nixpkgs: `/nix/store/78n6xdchpc0ykc9vpm4vmfmlxvsqnair-source`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant