From 1a203e5a26455690c4e57dc4d985ee11b7a8b90f Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Fri, 23 Jan 2026 21:32:35 -0800 Subject: [PATCH] Adds instructions to the readme for setting up node/yarn in a project. --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/README.md b/README.md index e69de29..e6a825a 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,87 @@ +# Project Template + +This repository is a starter template. +Replace this README with documentation specific to your project once you begin development. + +The notes below apply only if you choose to build a Node.js project using this template. + +--- + +## If your project will use Node.js + +Use Node 22 or newer for development. + +Check your version: + +``` +node --version +``` + +If your version is older than 22, update using nvm: + +``` +nvm install --lts +``` + +(Optional) Make the new version your default: + +``` +nvm alias default +``` + +After running `yarn init`, you may add a minimum Node version requirement to your `package.json`: + +```json +"engines": { + "node": ">=22" +} +``` + +This helps ensure you do not accidentally use an outdated Node version. + +--- + +## If your project will use Yarn (Berry) + +This template assumes modern Yarn (Yarn 4+), managed by Corepack. + +Enable Corepack: + +``` +corepack enable +``` + +Update Yarn to the latest stable version: + +``` +corepack prepare yarn@stable --activate +``` + +Install dependencies: + +``` +yarn install +``` + +If you want Yarn to error (instead of warn) when the Node version does not satisfy the `engines` field, add this to `.yarnrc.yml`: + +```yaml +enableStrictEngineChecks: true +``` + +--- + +## If your project will use containers + +If you plan to build or deploy using Docker, choose a base image that matches your development environment. +For Node.js projects, a common choice is: + +``` +FROM node:24 +``` + +--- + +## Replace this README + +Once you know what your project will be (Node, C++, Python, etc.), replace this file with documentation specific to your build, run, and deployment steps.