Tooling: Node, pnpm, and the monorepo
This monorepo is a pnpm workspace. Install and Corepack always start from the repository root (ftn-site/), not from a nested app folder.
Pins (source of truth)
| Pin | Where |
|---|---|
Node.js |
Root |
pnpm |
Root |
Build-script allowlist |
Root |
Install policy |
Root |
Workspace members (why “4 projects”)
pnpm-workspace.yaml lists three packages. pnpm also treats the root as a workspace project. That is four members:
-
ftn-site(root) — shared tooling (dprint, Biome), deploy helper scripts, workspace config. -
site-nextjs— official Next.js app (the one you develop and deploy). -
shared— shared design tokens / utilities. -
site-solidstart— retired archive; still a workspace package so the lockfile stays coherent. Do not add product features.
Product work happens in site-nextjs. The other members exist for shared code and history.
First-time machine setup
-
Install Node.js 24 (nodejs.org LTS/Current that reports
v24.x, or a version manager pointed at 24). -
Enable Corepack (ships with Node) and activate the repo’s pnpm pin from the repo root:
cd Z:\code\github.com\FoodTruckNerdz\ftn-site # or your clone path corepack enable corepack prepare pnpm@11.17.0 --activate pnpm --versionYou should see
11.17.0. Do not runcorepack use pnpm@…only insidesite-nextjs/— that rewrites a nested pin and fights the root. -
Install dependencies at the root:
pnpm installIf pnpm asks about dependency build scripts, approve them (
pnpm approve-builds). Approvals are written intopnpm-workspace.yamlunderallowBuilds.
Day-to-day Next.js loop
Use two terminals, both under site-nextjs after the root install:
cd site-nextjs
copy .env.example .env.local # first time; then fill secrets
pnpm exec convex dev # terminal A — keep running
pnpm dev # terminal B — http://localhost:3000
Common scripts (from site-nextjs/):
-
pnpm dev— Next.js + Turbopack -
pnpm build/pnpm start— production build / serve -
pnpm lint— Next lint -
pnpm format/pnpm format:fix— dprint check / write -
pnpm format:biome— Biome format write
Version-fight checklist
-
Wrong Node major → native modules (
better-sqlite3) ABI crash. Fix Node to 24, reinstall (pnpm installat root). -
packageManagermismatch → Corepack error about 10.x vs 11.x. Only the root field should define pnpm; activate withcorepack prepare pnpm@11.17.0 --activate. -
pnpmfield in package.json ignored → settings belong inpnpm-workspace.yaml(allowBuilds,minimumReleaseAge, etc.). -
Install from the wrong directory → always
pnpm installat the repo root so the workspace lockfile and all four members stay in sync. -
ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION→ a dependency in the lockfile is newer thanminimumReleaseAge. This repo setsminimumReleaseAge: 0inpnpm-workspace.yaml; if you raise it, wait or exclude packages withminimumReleaseAgeExclude. -
Aborted removal of modules directory(no TTY) → major pnpm upgrades may need to recreatenode_modules. Re-run with$env:CI='true'(PowerShell) or setconfirmModulesPurge: falseinpnpm-workspace.yamlfor automation.
Changing the pnpm version (maintainers)
From the repository root:
corepack use pnpm@11.17.0
That updates root packageManager (with integrity hash). Commit package.json and any lockfile churn together. Do not leave nested packages on a different pin.
Related
-
Getting started — short path into the Next app