Eternaltwin

Home | Tools

Yarn

Official website | GitHub

Yarn is a modern package manager for Node.js and the web. Compared to other such package managers (e.g. npm), it is faster, more reliable, and more flexible.

Eternaltwin uses Yarn Berry (Yarn 4), pinned to an exact version committed in the repository: .yarn/releases/yarn-4.12.0.cjs, referenced by yarnPath in .yarnrc.yml and by "packageManager": "yarn@4.12.0" in package.json. nodeLinker is set to node-modules, so dependencies are installed into regular node_modules folders (no Plug'n'Play).

Installation

Do not install Yarn globally with npm install --global yarn: that installs the legacy Yarn 1 line, not the version this repository is pinned to.

  1. Install Node.js.
  2. Enable Corepack, Node's package manager shim, which ships with Node.js:
    corepack enable
    
  3. From the repository root, run any yarn command. Corepack reads packageManager from package.json, and the project's own .yarn/releases/yarn-4.12.0.cjs (declared via yarnPath in .yarnrc.yml) takes over automatically. There is nothing else to install.

Check your installation with yarn --version (run from inside the repository) — it should print 4.12.0.

Usage

  • yarn install: install dependencies for all workspaces, following .yarnrc.yml and the workspaces field of package.json.
  • yarn run <task> (or yarn <task> when it does not collide with a built-in Yarn command): run a script from the current workspace's package.json. See package.json.
  • yarn dlx <package>: run a package's binary without adding it as a dependency (equivalent to npx).
  • yarn up <package>: upgrade a dependency across the workspace, e.g. yarn up '*' '!@eternaltwin/*' to update all non-Eternaltwin TypeScript dependencies.
  • yarn set version <version>: change the pinned Yarn release (updates yarnPath and downloads the new binary into .yarn/releases/). Use yarn set version latest to update Yarn itself.