These instructions apply to the entire repository rooted at this directory.
- Repository root:
/Users/cblanquera/server/projects/stackpress/ingest - Package workspace:
ingest/ - Example workspaces:
examples/*
- This project uses
yarn, notnpm. - Use
yarnfor installs, tests, builds, and workspace commands unless the user explicitly asks for something else. - Do not replace documented
yarncommands withnpmequivalents.
- Use Node.js
22or newer for all installs, builds, tests, and scripts. - Prefer the newest available Node.js version when multiple
22.xor newer versions are installed. - If the resolved Node.js version is lower than
22, stop and switch to a compatible binary before continuing.
When you need a Node.js binary, resolve it in this order and stop at the first successful result:
- Check whether
nvmis installed. - If
nvmis installed, try to locate thenvmdirectory that contains installed Node.js versions. - If the
nvmdirectory cannot be located directly, try to usenvmitself to resolve a22+Node.js version. - If
nvmis not available or cannot produce a usable binary, check common OS-specific Node.js install paths. - If common paths do not contain Node.js
22+, inspect environment variables for a Node.js binary path. - If no compatible Node.js binary is found after all checks, stop the task and ask the user for the Node.js location.
- First check whether
nvmis available in the shell. - If it is available, prefer Node.js binaries managed by
nvm.
Check these locations and hints first:
NVM_DIR$HOME/.nvm$XDG_CONFIG_HOME/nvm$HOME/.config/nvm- Any shell profile entry that exports
NVM_DIR
Once the directory is found, look for installed Node.js binaries under:
<nvm-dir>/versions/node/
Choose the highest installed version that is >= 22.
Try to resolve Node.js through nvm commands instead of hard-coded paths. Prefer flows equivalent to:
- listing installed versions
- selecting the newest installed
22+version - using
nvm whichfor that version
Do not install a new Node.js version unless the user explicitly asks for that.
Check common Node.js binary locations for the current OS.
macOS and Linux common paths:
/usr/local/bin/node/opt/homebrew/bin/node/opt/local/bin/node/usr/bin/node
Windows common paths:
C:\Program Files\nodejs\node.exeC:\Program Files (x86)\nodejs\node.exe
Version-check any discovered binary and only use it if it is >= 22.
Check environment variables that may expose a Node.js binary or installation root, including:
PATHNODE_HOMENODE_BINNVM_BIN- other obvious project or shell variables that directly point to a Node.js executable
Only accept the result if the resolved binary reports version 22 or newer.
- Stop the task.
- Ask the user to provide the absolute path to a Node.js
22+binary.
- Before running project scripts, confirm that
node --versionis>= 22. - When a command must use a specific Node.js binary, prefer invoking that binary directly instead of relying on an ambiguous shell
PATH. - Do not downgrade Node.js for compatibility guesses.
- Do not continue with a lower Node.js version just because commands appear to work.
From the repository root:
- Install dependencies:
yarn install - Run tests:
yarn test - Build package:
yarn build
From the package workspace:
- Install dependencies:
yarn --cwd ingest install - Run tests:
yarn --cwd ingest test - Build package:
yarn --cwd ingest build