node2nix icon indicating copy to clipboard operation
node2nix copied to clipboard

Can not pinpoint dependency

Open Jomik opened this issue 6 years ago • 3 comments

I am using buildNodePackage with src set to https://github.com/meain/vim-package-info and I get the below error. I need to get the node_modules folder to build the vim plugin. I do similar here for a project that has a yarn.lock file. https://gitlab.com/Jomik/nur-expressions/blob/master/pkgs/vimPlugins/overrides.nix#L6

Error log ``` pinpointing versions of dependencies... WARNING: cannot pinpoint dependency: semver-utils, context: /nix/store/4y7x3ffaf8swrkbip91af0glm2nij8rz-node-vim-package-info-modules-2019-04-20-2019-04-20/lib/node_modules/vim-package-info WARNING: cannot pinpoint dependency: toml, context: /nix/store/4y7x3ffaf8swrkbip91af0glm2nij8rz-node-vim-package-info-modules-2019-04-20-2019-04-20/lib/node_modules/vim-package-info patching script interpreter paths in . npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at: npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in: npm ERR! /build/.npm/_logs/2019-04-22T17_51_55_293Z-debug.log

</details>

Jomik avatar Apr 22 '19 17:04 Jomik

Hi,

I don't exactly know how you are using node2nix, but if I create a JSON configuration file, such as:

[
  { "vim-package-info": "meain/vim-package-info" }
]

and use node2nix to generate expressions from it:

$ node2nix -i pkg.json

then I can successfully build the package as follows:

$ nix-build -A "vim-package-info-meain/vim-package-info"

I have to admin that I tried the development version. not the latest stable release. A new release should be there very soon!

svanderburg avatar Jun 03 '19 21:06 svanderburg

I switched to https://github.com/serokell/nix-npm-buildpackage instead. I was simply importing default.nix from here and then calling buildNodePackage with the attributes required. So I did not use the cli-tool, because that is not really the way I could use it, since I don't just need to build the nodejs package, I also had to wrap it in a vim plugin.

Jomik avatar Jun 06 '19 08:06 Jomik

I just ran into this; I'm fairly sure it's not a bug. This seems to happen when the package.json is out of sync with the package.lock (this can happen if nobody ever runs npm install or the generated package.lock isn't updated), and node2nix is asked to use a package.json.

In this scenario, node2nix seems to simply not install the given packages because it doesn't know which version to install, and throws this warning. Maybe this should become a fatal error, or the warning could be improved?

TLATER avatar Apr 06 '21 20:04 TLATER