I have made Qdrant node from pinecone node. I followed most of the steps in guide. I have succesfully linted and built my node. Than I linked it to ~/.n8n/custom. But nothing works
I tried copying folders like ‘utils’ and ‘shared’ into my node dir so dependencies are solved. Than I tried to move all files into my node/NodeName dir. So that did not change anything either.
C:\Users\Lanity\.n8n\custom>n8n start
Initializing n8n process
Error loading node "gonzales" from: "C:/Users/Lanity/.n8n/custom/node_modules/n8n-nodes-qdrant/node_modules/csso/lib/gonzales.cssp.node.js" - require(...).gonzales is not a constructor
evalmachine.<anonymous>:1
new (require('C:/Users/Lanity/.n8n/custom/node_modules/n8n-nodes-qdrant/node_modules/csso/lib/gonzales.cssp.node.js').gonzales)()
^
TypeError: require(...).gonzales is not a constructor
at evalmachine.<anonymous>:1:1
at Script.runInContext (node:vm:134:12)
at loadClassInIsolation (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\node_modules\n8n-core\src\ClassLoader.ts:9:16)
at CustomDirectoryLoader.loadNodeFromFile (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\node_modules\n8n-core\src\DirectoryLoader.ts:83:35)
at CustomDirectoryLoader.loadAll (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\node_modules\n8n-core\src\DirectoryLoader.ts:304:9)
at LoadNodesAndCredentials.runDirectoryLoader (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\LoadNodesAndCredentials.ts:257:3)
at LoadNodesAndCredentials.loadNodesFromCustomDirectories (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\LoadNodesAndCredentials.ts:175:4)
at LoadNodesAndCredentials.init (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\LoadNodesAndCredentials.ts:94:3)
at Start.init (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\commands\BaseCommand.ts:52:3)
at Start.init (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\commands\start.ts:209:3)
Error: Exiting due to an error.
TypeError: require(...).gonzales is not a constructor
Before that there was another similar error which was mostly like this but “require(…).isomorphic is not a constructor”. That error was solved by adding isomorphic npm package to node packahe
Main question
I do not have lots of experience in JS. So
My question is what could be wrong? Where I should look for solutions?
Information on system and setup
node 18.19.0
npm 10.2.3
n8n-nodes-langchain 0.6.0
n8n version: 1.21.0
Database (default: SQLite): SQLite
n8n EXECUTIONS_PROCESS setting (default: own, main): Do not start)
Running n8n via (Docker, npm, n8n cloud, desktop app): npm
You should only include the dependencies that your node needs so changes are it won’t need n8n, n8n-nodes-langchain or langchain as we already use those so you could make them dev dependencies instead.
It then looks like there could be an issue loading gonzales sadly I am not familiar with that package but looking at the docs for it gonzales-pe seems to be a replacement for it so you may not need to include that either.
Yeah! I tried to resolve “gonzales not a constructor” like I resolved “isomorphic not a constructor”. Now I am removing gonzales and isomorphic, because it is packages I did not use, than I will try running again and share results. Just in 5 minutes
C:\Users\Lanity\.n8n\custom>n8n start
Initializing n8n process
Error loading node "isomorphic" from: "C:/Users/Lanity/.n8n/custom/node_modules/n8n-nodes-qdrant/node_modules/@jsdevtools/ono/cjs/isomorphic.node.js" - require(...).isomorphic is not a constructor
evalmachine.<anonymous>:1
new (require('C:/Users/Lanity/.n8n/custom/node_modules/n8n-nodes-qdrant/node_modules/@jsdevtools/ono/cjs/isomorphic.node.js').isomorphic)()
^
TypeError: require(...).isomorphic is not a constructor
at evalmachine.<anonymous>:1:1
at Script.runInContext (node:vm:134:12)
at loadClassInIsolation (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\node_modules\n8n-core\src\ClassLoader.ts:9:16)
at CustomDirectoryLoader.loadNodeFromFile (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\node_modules\n8n-core\src\DirectoryLoader.ts:83:35)
at CustomDirectoryLoader.loadAll (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\node_modules\n8n-core\src\DirectoryLoader.ts:304:9)
at LoadNodesAndCredentials.runDirectoryLoader (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\LoadNodesAndCredentials.ts:257:3)
at LoadNodesAndCredentials.loadNodesFromCustomDirectories (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\LoadNodesAndCredentials.ts:175:4)
at LoadNodesAndCredentials.init (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\LoadNodesAndCredentials.ts:94:3)
at Start.init (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\commands\BaseCommand.ts:52:3)
at Start.init (C:\Users\Lanity\AppData\Roaming\nvm\v18.19.0\node_modules\n8n\src\commands\start.ts:209:3)
Error: Exiting due to an error.
TypeError: require(...).isomorphic is not a constructor
This is what I get without isomorphic and gonzales in dependencies and it is what I started with after I’ve built my node first time. If I add isomorphic package there is problem with gonzales not a constructor. Can you maybe point out some community-nodes which use n8n-nodes-langchain and n8n@ai-beta where I can look for a solution?
That looks like there is still a project issue of some kind, There are 2 community nodes that build on top of the langchain options the second one does have the source available.
Are updates for langchain nodes in plan? Will there be qdrant integration? Maybe I can somehow try to add my node to official n8n-nodes-langchain package?