this post was submitted on 24 Jan 2025
12 points (87.5% liked)

Programming

17920 readers
114 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

Figured I would just ask for the abstract basics. Just consider me an amateur noob. I was digging into ComfyUI code to look into integrating or rewriting a script of mine into a custom node for the first time. The source for custom nodes sourced through the ComfyUI node manager have some kind of Yarn package or system. I have no idea what that is or what it is used for and figured it might make a light conversation.

all 8 comments
sorted by: hot top controversial new old
[–] sudo@programming.dev 5 points 15 hours ago* (last edited 15 hours ago) (1 children)

Yarn > v1.22 is a very different beast than npm. After that version they introduced a "package-manager" field to package.json and yarn will install the specific version of yarn required by that package onto your root system and use that version.

There's probably some way to do that without messing with your root system but after I encountered that I went back to npm. Let something like nix handle the version of my build tool. Or at least install to my home directory like rustup or sbt.

[–] nitefox@sh.itjust.works 1 points 14 hours ago
[–] roadrunner_ex@lemmy.ca 13 points 2 days ago (3 children)

So, there are a lot of words in the post that I'm not familiar with (LoRA, Oobabooga, CivitAI). However, I think those are details about the actual library or package you're looking at, so I will not touch any of that.

I can strict answer the question "what is Yarn?"

Long story short, it's a direct "competitor" to NPM (Node Package Manager). In the earlier days of Node and NPM, Yarn was an attempt to improve certain weaknesses perceived in NPM (including speed and security). Yarn is still used in many codebases, but it's become less popular over the years as NPM has resolved many of the things that Yarn sought to fix. Also, Yarn version 2 made a major design change which some have viewed as too radical (though I'm unclear on the details as I've only dabbled in v2).

https://en.wikipedia.org/wiki/Yarn_(package_manager)

[–] kvadd@lemmy.world 4 points 15 hours ago

Also, yarn is developed by facebook.

[–] limer@lemmy.dbzer0.com 3 points 1 day ago

yarn was popular because it could be a drop down replacement for npm. Now there must be a lock in to support edge cases most projects don’t need (or know about)?

[–] shortrounddev@lemmy.world 4 points 1 day ago

It's like a better version of npm. monorepos work better with yarn

[–] RagingRobot@lemmy.world 4 points 1 day ago

Yarn is a package manager. It lets you install libraries and run scripts for JavaScript.

If you need to add a library to your project you do something like 'yarn add react' for example. That would install react in your project.

If you write code that needed to be compiled or you wanted to minify it or change it in some way you can also use yarn to help.