From a3caa09df4c2fa6d3f8ca331d423f973bf133e64 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 27 Jan 2025 13:03:06 -0800 Subject: [PATCH] server: fixup node modules search path on HA --- server/src/plugin/runtime/node-fork-worker.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/plugin/runtime/node-fork-worker.ts b/server/src/plugin/runtime/node-fork-worker.ts index b3923c55c..0199413fd 100644 --- a/server/src/plugin/runtime/node-fork-worker.ts +++ b/server/src/plugin/runtime/node-fork-worker.ts @@ -48,7 +48,12 @@ export class NodeForkWorker extends ChildProcessWorker { this.pluginId ]; - const nodePaths: string[] = [path.resolve(__dirname, '..', '..', '..', 'node_modules')]; + const nodePaths: string[] = [ + // /server/node_modules/@scrypted/server/node_modules + path.resolve(__dirname, '..', '..', '..', 'node_modules'), + // /server/node_modules + path.resolve(process.cwd(), 'node_modules'), + ]; if (env?.NODE_PATH) nodePaths.push(env.NODE_PATH); if (process.env.NODE_PATH)