nix-community / npmlock2nix

nixify npm based packages [maintainer=@andir]
Apache License 2.0
130 stars 42 forks source link

Problems with lerna project #139

Open poelzi opened 2 years ago

poelzi commented 2 years ago

I try to create a flake.nix for a lerna based uhk-agent. My current version is here

The problem starts with 'lerna bootstrap' postinstall command, which will fail because at that point the cwd will not be the root of project and lerna.json will not exist. Trying to use the patchPhase to remove the postInstall hook does not work.

My next try was to no use lerna and instead use the 'node_modules' dervation on each dependency in the packages folder and use those as buildInputs in the uhk-agent derivation. But it complains about missing cache: uhk-agent> npm ERR! request to https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz failed: cache mode is 'only-if-cached' but no cached response is available.

How do I use npmlock2nix with lerna based projects ?

flokli commented 2 years ago

@poelzi which npm version do you have available? This might be https://github.com/nix-community/npmlock2nix/issues/140.

poelzi commented 2 years ago

yes, that might be the reason. I'm forced to node 16.x due project constraints