refactor: Clean all instances of isNpmAvailable (#10891)

This commit is contained in:
Ricardo Espinoza
2024-09-20 10:38:52 -04:00
committed by GitHub
parent 30261bdc91
commit 583d3a7acb
9 changed files with 3 additions and 46 deletions

View File

@@ -1,5 +1,4 @@
import type { FrontendSettings } from '@n8n/api-types';
import { exec as callbackExec } from 'child_process';
import cookieParser from 'cookie-parser';
import express from 'express';
import { access as fsAccess } from 'fs/promises';
@@ -7,7 +6,6 @@ import helmet from 'helmet';
import { InstanceSettings } from 'n8n-core';
import { resolve } from 'path';
import { Container, Service } from 'typedi';
import { promisify } from 'util';
import { AbstractServer } from '@/abstract-server';
import config from '@/config';
@@ -67,8 +65,6 @@ import '@/workflows/workflow-history/workflow-history.controller.ee';
import '@/workflows/workflows.controller';
import { EventService } from './events/event.service';
const exec = promisify(callbackExec);
@Service()
export class Server extends AbstractServer {
private endpointPresetCredentials: string;
@@ -174,9 +170,6 @@ export class Server extends AbstractServer {
const { frontendService } = this;
if (frontendService) {
frontendService.addToSettings({
isNpmAvailable: await exec('npm --version')
.then(() => true)
.catch(() => false),
versionCli: N8N_VERSION,
});