Fix for #2388
Ylian Saint-Hilaire committed
Mar 13, 2021 at 15:01 UTC
5b16e696c213e6b2b3d98bb7d9c73eb085f0c480
2 files changed
+2
-2
meshcentral.js
+1
-1
@@ -2975,7 +2975,7 @@ function InstallModule(modulename, func, tag1, tag2) {
2975
// Get the working directory
2976
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, '../..'); }
2977
2978
- child_process.exec(npmpath + ` install --no-save --no-optional ${modulename}`, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) {
2978
+ child_process.exec(npmpath + ` install --no-optional ${modulename}`, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) {
2979
if ((error != null) && (error != '')) {
2980
var mcpath = __dirname;
2981
if (mcpath.endsWith('\\node_modules\\meshcentral') || mcpath.endsWith('/node_modules/meshcentral')) { mcpath = require('path').join(mcpath, '..', '..'); }
translate/translate.js
+1
-1
@@ -1021,7 +1021,7 @@ function InstallModule(modulename, func, tag1, tag2) {
1021
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, '../..'); }
1022
1023
// Looks like we need to keep a global reference to the child process object for this to work correctly.
1024
- InstallModuleChildProcess = child_process.exec('npm install --no-optional --no-save ' + modulename, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) {
1024
+ InstallModuleChildProcess = child_process.exec('npm install --no-optional ' + modulename, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) {
1025
InstallModuleChildProcess = null;
1026
if ((error != null) && (error != '')) {
1027
log('ERROR: Unable to install required module "' + modulename + '". May not have access to npm, or npm may not have suffisent rights to load the new module. Try "npm install ' + modulename + '" to manualy install this module.\r\n');