From 4d7ca3d4d7088baa9f1109c3ccc4645df28f515a Mon Sep 17 00:00:00 2001 From: Nic-dorman Date: Tue, 12 May 2026 11:49:58 +0100 Subject: [PATCH] chore(deps): pin engines.node >=22.12.0 to fix local vitest on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vitest fails locally on Windows + Node 20.18 with: Error: require() of ES Module .../node_modules/vue/index.mjs not supported. Instead change the require of .../node_modules/vue/index.mjs to a dynamic import() which is available in all CommonJS modules. The Nuxt vitest environment loads @vue/test-utils via require(), which in turn does `require('vue')`. Vue 3.5 is pure ESM, so Node 20.x rejects the require call. Node 22.12+ enabled require(esm) by default, fixing this class of error without any code change on our side. CI already uses lts/* (Node 22 LTS as of Nov 2024), so this only formalises the floor. Existing devs on Node 20 get an EBADENGINE warning (not an error) on `npm install` and a clear signal to upgrade. Three changes: 1. package.json — add `engines.node: ">=22.12.0"`. Also bumps the @vue/test-utils floor from ^2.4.6 to ^2.4.9, matching what npm resolves to today. 2. .nvmrc — `22`, so devs using nvm pick the right Node automatically. 3. package-lock.json — picks up the engines field plus a stale 0.6.7 version-bump catchup that the release commits missed. Co-Authored-By: Claude Opus 4.7 (1M context) --- .nvmrc | 1 + package-lock.json | 9 ++++++--- package.json | 5 ++++- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/package-lock.json b/package-lock.json index ae4d91b..5315b2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ant-gui", - "version": "0.6.7", + "version": "0.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ant-gui", - "version": "0.6.7", + "version": "0.7.0", "dependencies": { "@pinia/nuxt": "^0.5.0", "@reown/appkit": "^1.8.19", @@ -26,13 +26,16 @@ "devDependencies": { "@nuxt/test-utils": "^3.23.0", "@tauri-apps/cli": "^2.0.0", - "@vue/test-utils": "^2.4.6", + "@vue/test-utils": "^2.4.9", "autoprefixer": "^10.4.27", "happy-dom": "^20.8.9", "postcss": "^8.5.8", "tailwindcss": "^3.4.19", "typescript": "^5.5.0", "vitest": "^3.2.4" + }, + "engines": { + "node": ">=22.12.0" } }, "node_modules/@adraffy/ens-normalize": { diff --git a/package.json b/package.json index 27d5e17..b36971f 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "0.7.0", "private": true, "type": "module", + "engines": { + "node": ">=22.12.0" + }, "scripts": { "dev": "nuxt dev --port 1420 --no-fork", "build": "nuxt generate", @@ -32,7 +35,7 @@ "devDependencies": { "@nuxt/test-utils": "^3.23.0", "@tauri-apps/cli": "^2.0.0", - "@vue/test-utils": "^2.4.6", + "@vue/test-utils": "^2.4.9", "autoprefixer": "^10.4.27", "happy-dom": "^20.8.9", "postcss": "^8.5.8",