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.

  • sudo@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    12 hours ago

    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.

  • roadrunner_ex@lemmy.ca
    link
    fedilink
    English
    arrow-up
    13
    ·
    2 days ago

    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)

  • RagingRobot@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    2 days 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.