Automatic set of npmpath if possible.

This commit is contained in:
Ylian Saint-Hilaire 2020-02-04 11:10:02 -08:00
parent 31e0f5c726
commit 908b308c30
2 changed files with 10 additions and 1 deletions

View File

@ -1247,6 +1247,15 @@ function CreateMeshCentralServer(config, args) {
if (obj.config.settings.autobackup && (typeof obj.config.settings.autobackup.backupintervalhours == 'number')) { if (obj.config.settings.autobackup && (typeof obj.config.settings.autobackup.backupintervalhours == 'number')) {
setInterval(obj.db.performBackup, obj.config.settings.autobackup.backupintervalhours * 60 * 60 * 1000); setInterval(obj.db.performBackup, obj.config.settings.autobackup.backupintervalhours * 60 * 60 * 1000);
} }
// Setup the Node+NPM path if possible, this makes it possible to update the server even if NodeJS and NPM are not in default paths.
if (obj.args.npmpath == null) {
try {
var nodepath = process.argv[0];
var npmpath = obj.path.join(obj.path.dirname(process.argv[0]), 'npm');
if (obj.fs.existsSync(nodepath) && obj.fs.existsSync(npmpath)) { obj.args.npmpath = (nodepath + ' ' + npmpath); }
} catch (ex) { }
}
}); });
}); });
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "meshcentral", "name": "meshcentral",
"version": "0.4.8-l", "version": "0.4.8-m",
"keywords": [ "keywords": [
"Remote Management", "Remote Management",
"Intel AMT", "Intel AMT",