Automatic set of npmpath if possible.

This commit is contained in:
Ylian Saint-Hilaire 2020-02-04 11:10:02 -08:00
parent 6ea656383b
commit ab992472f4
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')) {
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",
"version": "0.4.8-l",
"version": "0.4.8-m",
"keywords": [
"Remote Management",
"Intel AMT",