Yarn - HVboom/HowTo-DigitalOcean GitHub Wiki

Description

Yarn is a new node package manager that replaces the existing workflow for the npm client or other package managers while remaining compatible with the npm registry. It has the same feature set as existing workflows while operating faster, more securely, and more reliably.

💬 copied from package description

Setup Yarn package manager on Ubuntu

  • Install as normal package not as part of cmdtest

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    sudo apt update && sudo apt install yarn

Setup Yarn package manager on FreeBSD

  • Install as normal package

    sudo pkg install yarn
  • Add path to binaries installed via Yarn to $HOME/.profile

    ...
    if [ `echo "$PATH" | grep -c "$HOME/.yarn/bin"` == 0 ] 
    then
      export PATH="$PATH:$HOME/.yarn/bin" # Add Yarn to PATH for scripting
    fi
    ...

Yarn & Angular

  • Install Angular client

    yarn global add @angular/cli
  • Creating a new Angular app

    ng new <project> --skip-install
    cd <project>
    ng set --global packageManager=yarn
⚠️ **GitHub.com Fallback** ⚠️