Describe the problem/error/question
I experimented with using require from a code node and it appears that to use require for a lib that is not under node_modules, we cannot use relative paths.
Essentially this works: const myLib = “/dev4/n8n/fcts/myFct”;
But this DOES NOT: const myLib = “./fcts/myFct”;
even though the current dir is /dev4/n8n (confirmed by using cwd() command)
Is this indeed intended? Asking as it is not intuitive - I suppose this may be done for security reasons?
Information on your n8n setup
- n8n version: 1.80.5
- Database (default: SQLite): default
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- **Running n8n via: local install **
- **Operating system: Windows 11 **