mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 04:42:54 -05:00
Align and specify NPM module versions (#5685)
The Dockerfile specifies NPM modules to be installed. However, some do not specify a version, so the latest is installed. Later in meshcentral.js mainStart() specific versions are required. If they don't match the latest version, all modules will be reinstalled to get the specific versions. #5684 Soft version conflict on NPM modules causes NPM modules to be installed on startup in Docker #5545 Docker on Debian 11 fails on version 1.1.15 and 1.1.16 giving NPM errors #5681 InstallModules() installs all modules, not just missing modules (regression)
This commit is contained in:
@@ -1108,7 +1108,7 @@ function InstallModuleEx(modulenames, func) {
|
||||
if ((__dirname.endsWith('/node_modules/meshcentral')) || (__dirname.endsWith('\\node_modules\\meshcentral')) || (__dirname.endsWith('/node_modules/meshcentral/')) || (__dirname.endsWith('\\node_modules\\meshcentral\\'))) { parentpath = require('path').join(__dirname, '../..'); }
|
||||
|
||||
// Looks like we need to keep a global reference to the child process object for this to work correctly.
|
||||
InstallModuleChildProcess = child_process.exec(`npm install --no-audit --no-package-lock --no-optional --omit=optional --no-save ${names}`, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) {
|
||||
InstallModuleChildProcess = child_process.exec(`npm install --no-audit --no-package-lock --no-optional --omit=optional --no-save ${names}`, { maxBuffer: 512000, timeout: 300000, cwd: parentpath }, function (error, stdout, stderr) {
|
||||
InstallModuleChildProcess = null;
|
||||
if ((error != null) && (error != '')) {
|
||||
log('ERROR: Unable to install required modules. May not have access to npm, or npm may not have suffisent rights to load the new modules. Try "npm install ' + names + '" to manualy install the modules.\r\n');
|
||||
|
||||
Reference in New Issue
Block a user