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

pnpm? #79

Closed
wmertens opened this issue Mar 29, 2018 · 5 comments · Fixed by NixOS/nixpkgs#54633
Closed

pnpm? #79

wmertens opened this issue Mar 29, 2018 · 5 comments · Fixed by NixOS/nixpkgs#54633

Comments

@wmertens
Copy link

I just stumbled on https://pnpm.js.org/ - it uses a nice mix of symlinks and hardlinks to install deps, and seems to work properly for most packages.

It actually seems already quite a long way towards nix - the modules are stored separately in a cache and then combined in the project.

Maybe some ideas from there can be used here, or we can add the option to use the nix store in there.

They are using hardlinks to copy the modules in place, so to keep the original modules in the store they should either be mentioned in some file, or the hardlinks should be symlinks.

@adisbladis
Copy link

adisbladis commented Apr 30, 2018

A while back I started a separate project for this: https://github.com/adisbladis/pnpm2nix/

@svanderburg
Copy link
Owner

Perhaps with hard linking we could save some of the duplication penalties, but I think this is already addressed by Nix -- Nix has an optimization feature as well that replaces duplicate files by hard links (e.g. nix-store --optimise). It just needs to be invoked explicitly, or it can be enabled for each package that gets deployed by adjusting the nix.conf configuration file.

I'm not sure what other concepts I could borrow -- the purpose of node2nix is not to alter or improve upon NPM, only to make integration work as conveniently as possible while retaining compatibility.

btw pnpm2nix is a nice effort!

@onetom
Copy link

onetom commented Nov 26, 2018

pnpm was actually working until recently, like:

nix-shell -p nodePackages_8_x.pnpm

so I think this issue can be closed.

It currently fails, but that might be unrelated to node2nix.
If it's related, it should be a separate issue.

./pnpm/lib/node_modules/buffer/bin/download-node-tests.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/2wm0059s37nmyqb0qxlsdmcj0d4hlf2a-nodejs-8.12.0/bin/node"
./pnpm/lib/node_modules/tree-kill/cli.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/2wm0059s37nmyqb0qxlsdmcj0d4hlf2a-nodejs-8.12.0/bin/node"
No package-lock.json file found, reconstructing...
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:../../privatePackages/assert-project

npm ERR! A complete log of this run can be found in:
npm ERR!     /private/var/folders/sp/dp9j0mxs3b3c_3g6sfs_7qwm0000gn/T/nix-build-node-pnpm-2.18.2.drv-0/.npm/_logs/2018-11-26T05_47_44_227Z-debug.log
builder for '/nix/store/9bbcavn00awfrdcfp5ahh0a48y3ybidj-node-pnpm-2.18.2.drv' failed with exit code 1
error: build of '/nix/store/9bbcavn00awfrdcfp5ahh0a48y3ybidj-node-pnpm-2.18.2.drv' failed

@srghma
Copy link
Contributor

srghma commented Jan 26, 2019

issue mentioned at #79 (comment) is fixed

@svanderburg
Copy link
Owner

Closing this, because the corresponding pnpm issue was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants