diff --git a/meshcentral.js b/meshcentral.js index 3afecc7d..38e3cc51 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -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) { } + } }); }); }; diff --git a/package.json b/package.json index 19e0f18b..6a593133 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.8-l", + "version": "0.4.8-m", "keywords": [ "Remote Management", "Intel AMT",