From 12ca068584ba1ce4196d2b89176fcf0b6d2eda7e Mon Sep 17 00:00:00 2001 From: DYH1319 <1245687900@qq.com> Date: Thu, 5 Nov 2026 11:19:43 +0800 Subject: [PATCH] fix(host): restore image-size 1.x and repair the Host lockfile The merge of #1118 left package-lock.json with queue 6.0.2 but without its dependency inherits. The build copies this lockfile next to the generated package.json, which requests image-size ^1.2.1, so npm reuses the locked queue, never installs inherits, and Electron fails at startup with "Cannot find module 'inherits'". Go back to image-size ^1.2.1 in the Host: it matches package.template.json and the callback API that main.js uses, which 2.x no longer provides. Co-Authored-By: Claude Opus 5.5 --- src/ElectronNET.Host/package-lock.json | 39 +++++++++----------------- src/ElectronNET.Host/package.json | 2 +- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/ElectronNET.Host/package-lock.json b/src/ElectronNET.Host/package-lock.json index b07cace..3cbb803 100644 --- a/src/ElectronNET.Host/package-lock.json +++ b/src/ElectronNET.Host/package-lock.json @@ -12,7 +12,7 @@ "dasherize": "^2.0.0", "electron-host-hook": "file:./ElectronHostHook", "electron-updater": "^6.8.9", - "image-size": "^2.0.3", + "image-size": "^1.2.1", "socket.io": "^4.8.1" }, "devDependencies": { @@ -984,15 +984,18 @@ } }, "node_modules/image-size": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-2.0.3.tgz", - "integrity": "sha512-9BJAtVCBth+76NwqnEfWr3PiRnYhbquk6K/USuQ1GQajz5NgLzO7tNsnoNjHfO7LuftgkBf+CCH6j28hjMbIYQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", + "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", "license": "MIT", + "dependencies": { + "queue": "6.0.2" + }, "bin": { "image-size": "bin/image-size.js" }, "engines": { - "node": ">=18" + "node": ">=16.x" } }, "node_modules/import-fresh": { @@ -1022,6 +1025,12 @@ "node": ">=0.8.19" } }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1348,26 +1357,6 @@ "inherits": "~2.0.3" } }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true, - "license": "MIT" - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", diff --git a/src/ElectronNET.Host/package.json b/src/ElectronNET.Host/package.json index 6c79742..74cc686 100644 --- a/src/ElectronNET.Host/package.json +++ b/src/ElectronNET.Host/package.json @@ -18,7 +18,7 @@ "dependencies": { "dasherize": "^2.0.0", "electron-host-hook": "file:./ElectronHostHook", - "image-size": "^2.0.3", + "image-size": "^1.2.1", "electron-updater": "^6.8.9", "socket.io": "^4.8.1" },