From 02ac532e37e7add3dba43371a94141bfb7627cbd Mon Sep 17 00:00:00 2001 From: Andriy Utkin Date: Tue, 27 Feb 2024 11:12:46 +0000 Subject: [PATCH] www/ajax/discoverCameras.php: set NODE_PATH for js tool cmd In bluecherry-node-onvif package, we bundle the dependencies necessary to avoid relying on packaging of all of them the Debian way. The command "node .../discovery_json/node-onvif.js" doesn't work as it doesn't look for node_modules where we put them, /usr/share/nodejs/onvif/node_modules . This change passes NODE_PATH env var to `node` interpreter command, which is handled as expected by PHP's popen(). --- www/ajax/discoverCameras.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/ajax/discoverCameras.php b/www/ajax/discoverCameras.php index 012f7787..67fcbec8 100644 --- a/www/ajax/discoverCameras.php +++ b/www/ajax/discoverCameras.php @@ -175,7 +175,7 @@ public function postData() ); $tools = Array( - "node /usr/share/bluecherry/onvif/discovery_json/node-onvif.js", + "NODE_PATH=/usr/share/nodejs/onvif/node_modules node /usr/share/bluecherry/onvif/discovery_json/node-onvif.js", "/usr/share/bluecherry/onvif/discovery_json/onvif_tool", ); foreach ($tools as $tool) {