diff --git a/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts b/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts index 2a78198234370..a54b982cd8054 100644 --- a/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts @@ -53,6 +53,14 @@ export const vmResolver = makeResolverFromLegacyOptions({ modules: external ? ['langchain', ...external.split(',')] : ['langchain'], transitive: false, }, + resolve(moduleName, parentDirname) { + if (moduleName.match(/^langchain\//)) { + return require.resolve(`@n8n/n8n-nodes-langchain/node_modules/${moduleName}.cjs`, { + paths: [parentDirname], + }); + } + return; + }, builtin: builtIn?.split(',') ?? [], });