Tuesday 11 December 2018

Introduction to Yarn

Yarn
  • package manager
  • developed by Facebook
  • uses the same package.json as npm
  • uses its own lock file - yarn.lock (not package-lock.json like npm)
  • if installing it on Windows via installer, Node.js has to be installed first
  • once installed re-launch terminal and type yarn -v to verify that it's installed successfully and see its version
  • if you check out some project which uses yarn, you would typically first run yarn install to install all the dependencies of project
  • each module has npm-based and yarn-based packages so can be installed via either dependency manager. E.g. babel-core:
    • npm: npm install --save-dev @babel/core
    • yarn: yarn add @babel/core --dev

No comments: