diff --git a/packages/cli/commands/import/credentials.ts b/packages/cli/commands/import/credentials.ts index da6453a650472..9a0170ba59285 100644 --- a/packages/cli/commands/import/credentials.ts +++ b/packages/cli/commands/import/credentials.ts @@ -95,7 +95,7 @@ export class ImportCredentialsCommand extends Command { inputPath = inputPath.replace(/\/$/g, ''); - const files = await glob(`${inputPath}/*.json`); + const files = await glob('*.json', { cwd: inputPath }); totalImported = files.length; diff --git a/packages/cli/commands/import/workflow.ts b/packages/cli/commands/import/workflow.ts index 34a5c97b8cfb5..5b08a4d0ed035 100644 --- a/packages/cli/commands/import/workflow.ts +++ b/packages/cli/commands/import/workflow.ts @@ -117,7 +117,7 @@ export class ImportWorkflowsCommand extends Command { inputPath = inputPath.replace(/\/$/g, ''); - const files = await glob(`${inputPath}/*.json`); + const files = await glob('*.json', { cwd: inputPath }); totalImported = files.length; diff --git a/packages/cli/src/LoadNodesAndCredentials.ts b/packages/cli/src/LoadNodesAndCredentials.ts index f302638d07156..7062aad8b05eb 100644 --- a/packages/cli/src/LoadNodesAndCredentials.ts +++ b/packages/cli/src/LoadNodesAndCredentials.ts @@ -493,7 +493,9 @@ class LoadNodesAndCredentialsClass { * @returns {Promise} */ async loadDataFromDirectory(setPackageName: string, directory: string): Promise { - const files = await glob(path.join(directory, '**/*.@(node|credentials).js')); + const files = await glob('**/*.@(node|credentials).js', { + cwd: directory, + }); for (const filePath of files) { const [fileName, type] = path.parse(filePath).name.split('.'); diff --git a/packages/nodes-base/nodes/ReadBinaryFiles/ReadBinaryFiles.node.ts b/packages/nodes-base/nodes/ReadBinaryFiles/ReadBinaryFiles.node.ts index 3741d9344ecdf..4c9ec040e3339 100644 --- a/packages/nodes-base/nodes/ReadBinaryFiles/ReadBinaryFiles.node.ts +++ b/packages/nodes-base/nodes/ReadBinaryFiles/ReadBinaryFiles.node.ts @@ -1,7 +1,6 @@ import { IExecuteFunctions } from 'n8n-core'; import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow'; import glob from 'fast-glob'; -import path from 'path'; import { readFile as fsReadFile } from 'fs/promises';