Skip to content

Commit b307df7

Browse files
add nodejs support
1 parent 299dc8d commit b307df7

6 files changed

Lines changed: 16 additions & 3 deletions

File tree

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Whether you need to build a blog, an e-commerce store, a landing page, or any ot
6969
## Requirements
7070

7171
- **Python** 3.9+
72-
- **Node.js** 18+ and **npm** on your `PATH` so the Python build can invoke them (you never run `npm` yourself for normal development or production builds)
72+
- **Node.js** **20.19+** or **22.12+** (LTS **22** recommended) and **npm** on your `PATH` so the Python build can invoke **Vite 8** (you never run `npm` yourself for normal development or production builds). The repo pins **22** via **`.nvmrc`**, **`netlify.toml`**, **`render.yaml`**, and **`amplify.yml`** where the host reads them.
7373

7474
## 🚀 How to Get Started
7575

@@ -248,9 +248,9 @@ Hosting platforms ship their own Python and Node images. See their current defau
248248
- **Cloudflare Pages**[Build image / language support](https://developers.cloudflare.com/pages/configuration/build-image/)
249249
- **Render**[Environment](https://render.com/docs/environment) and [native runtimes](https://render.com/docs/native-runtimes)
250250

251-
#### **• Node / npm not found**
251+
#### **• Node / npm not found or “Vite requires Node.js …”**
252252

253-
If the build fails with **npm was not found in PATH** or similar, install [Node.js](https://nodejs.org/) (LTS). You still only run `python3 kaktos.py` or `python3 kaktos.py build`, and the first run installs `frontend/node_modules` when needed.
253+
Install [Node.js](https://nodejs.org/) **22 LTS** (or **20.19+**). On hosts that ignore `.nvmrc`, set **`NODE_VERSION=22`** (or equivalent) in the service environment. You still only run `python3 kaktos.py` or `python3 kaktos.py build`; the first run installs `frontend/node_modules` when needed.
254254

255255
#### **• LiveReload did not refresh the browser**
256256

amplify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ frontend:
33
phases:
44
preBuild:
55
commands:
6+
- nvm install 22
7+
- nvm use 22
8+
- node -v
69
- ln -fs /usr/local/bin/pip3.9 /usr/bin/pip3
710
- ln -fs /usr/local/bin/python3.9 /usr/bin/python3
811
- python3 -m pip install -r requirements.txt --user

frontend/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",
6+
"engines": {
7+
"node": ">=20.19.0"
8+
},
69
"scripts": {
710
"build": "vite build"
811
},

netlify.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[build]
22
command = "python3 kaktos.py build"
33
publish = "build"
4+
5+
# Vite 8+: Node 20.19+ or 22.12+ (see also repo root `.nvmrc`, `render.yaml`, `amplify.yml`).
6+
[build.environment]
7+
NODE_VERSION = "22"

render.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ services:
55
buildCommand: python3 kaktos.py build
66
staticPublishPath: build/
77
envVars:
8+
- key: NODE_VERSION
9+
value: "22"
810
- key: PYTHON_VERSION
911
value: 3.13.4

0 commit comments

Comments
 (0)