Added no-audit when installing NPM packages in the background.

Ylian Saint-Hilaire committed Nov 1, 2022 at 18:04 UTC 11fd5b39e811289610958852f871e5f31ad9cc46
1 file changed +3 -3
meshcentral.js
+3 -3
@@ -470,9 +470,9 @@ function CreateMeshCentralServer(config, args) {
470 const npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : '');
471 const env = Object.assign({}, process.env); // Shallow clone
472 if (typeof obj.args.npmproxy == 'string') { env['HTTP_PROXY'] = env['HTTPS_PROXY'] = env['http_proxy'] = env['https_proxy'] = obj.args.npmproxy; }
473 - const xxprocess = child_process.exec(npmpath + ' install --no-package-lock meshcentral' + version + npmproxy, { maxBuffer: Infinity, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) {
473 + const xxprocess = child_process.exec(npmpath + ' install --no-audit --no-package-lock meshcentral' + version + npmproxy, { maxBuffer: Infinity, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) {
474 if ((error != null) && (error != '')) { console.log('Update failed: ' + error); }
475 - });
475 + });
476 xxprocess.data = '';
477 xxprocess.stdout.on('data', function (data) { xxprocess.data += data; });
478 xxprocess.stderr.on('data', function (data) { xxprocess.data += data; });
@@ -3829,7 +3829,7 @@ function InstallModule(modulename, func, tag1, tag2) {
3829 // Get the working directory
3830 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, '../..'); }
3831
3832 - child_process.exec(npmpath + ` install --no-package-lock --no-optional ${modulename}`, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) {
3832 + child_process.exec(npmpath + ` install --no-audit --no-package-lock --no-optional ${modulename}`, { maxBuffer: 512000, timeout: 120000, cwd: parentpath }, function (error, stdout, stderr) {
3833 if ((error != null) && (error != '')) {
3834 var mcpath = __dirname;
3835 if (mcpath.endsWith('\\node_modules\\meshcentral') || mcpath.endsWith('/node_modules/meshcentral')) { mcpath = require('path').join(mcpath, '..', '..'); }