Yarn
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.
- Install Node.js.
- Enable Corepack, Node's package
manager shim, which ships with Node.js:
corepack enable
- From the repository root, run any
yarncommand. Corepack readspackageManagerfrompackage.json, and the project's own.yarn/releases/yarn-4.12.0.cjs(declared viayarnPathin.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.ymland theworkspacesfield ofpackage.json.yarn run <task>(oryarn <task>when it does not collide with a built-in Yarn command): run a script from the current workspace'spackage.json. See package.json.yarn dlx <package>: run a package's binary without adding it as a dependency (equivalent tonpx).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 (updatesyarnPathand downloads the new binary into.yarn/releases/). Useyarn set version latestto update Yarn itself.