Set up a Mac to run the project. Installs Node.js if needed and runs npm install.
do not narrate technical steps. the user doesn't need to know what you're checking or installing behind the scenes. keep all checks, downloads, and installs silent unless you need the user to do something.
only talk to the user at these moments:
$start to begin building"never mention node_modules, node -v, version numbers, npm, curl, or any technical terms in messages to the user.
silently check if node_modules/ exists in the project root. if it does, tell the user:
you're already set up! type
$startto begin building.
stop here. don't continue.
tell the user:
setting things up — give me a sec.
silently run node -v to check if Node.js is installed.
look up the latest LTS version from nodejs.org:
curl -fsSL https://nodejs.org/dist/index.json | python3 -c "import json,sys; print(next(r['version'] for r in json.load(sys.stdin) if r.get('lts')))"
the .pkg installer is universal (works on both Apple Silicon and Intel). download it:
curl -fSL -o /tmp/node-installer.pkg "https://nodejs.org/dist/{VERSION}/node-{VERSION}.pkg"
launch the installer:
open /tmp/node-installer.pkg
tell the user:
an installer just popped up — click Continue, then Install, and enter your password when it asks. come back here and tell me when it's done.
wait for the user to confirm before continuing. do not proceed until they say it's done.
silently verify node is available:
node -v
if node is not found, tell them:
hmm, let's try a quick fix — close Codex completely and reopen it, then type
$install-macagain.
stop here if node isn't found. don't continue.
silently clean up:
rm /tmp/node-installer.pkg
silently run:
npm install
this takes a minute or two. don't say anything unless it fails.
tell the user:
you're all set! type
$startto begin building.