From c5156f880e15d4e48903c1c04bb6bc141366e71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 15 Jun 2026 17:01:09 +0200 Subject: [PATCH] build: pin Node 22 with .nvmrc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build requires Node 22 — CI runs it and CLAUDE.md documents it — but nothing pinned the version locally, so a shell defaulting to an older Node (e.g. 18) fails the gulp build with ERR_REQUIRE_ESM. Several dependencies (del, postcss-custom-properties, …) are ESM-only and the gulpfile loads them via require(), which only works on Node >= 22's support for require()-ing ES modules. - add .nvmrc pinning Node 22 so `nvm use` selects the supported version - correct the CLAUDE.md constraint: it claimed the gulpfile uses dynamic import() for ESM-only deps, but it uses require(); document that this relies on Node 22 and name the other ESM-only dep that bites on older Node Verified: `nvm use && npm run bundle` passes on Node 22 and produces build/ui-bundle.zip. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --- .nvmrc | 1 + CLAUDE.md | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..2bd5a0a9 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/CLAUDE.md b/CLAUDE.md index 7546890e..3260d41c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,8 +63,10 @@ The numbered filenames define concatenation order: ## Key Constraints -- **Node 22** is required (matches CI). Use `nvm use` if you have nvm configured. +- **Node 22** is required (matches CI and `.nvmrc`). Run `nvm use` to select it. Older + versions fail the build: several dependencies (`del`, `postcss-custom-properties`, …) are + ESM-only and the gulpfile loads them with `require()`, which only works on Node ≥ 22's + support for `require()`-ing ES modules. - **npm ≥ 11.11.0** is required. - `js/vendor/` files are excluded from ESLint — do not add linting rules targeting them. - CSS custom properties are intentionally left un-prefixed (stylelint rule disabled). -- The `del` and `chokidar` packages are ESM-only; the gulpfile handles this with dynamic `import()`.