Running n8n via npm
Operating system: Windows
A basic problem I am new to n8n, trying to run Node.js modules in a function node but It does not work for me.
Any help is appreciated.
Running n8n via npm
Operating system: Windows
A basic problem I am new to n8n, trying to run Node.js modules in a function node but It does not work for me.
Any help is appreciated.
It looks like your topic is missing some important information. Could you provide the following if applicable.
Hi P.Y.
any further Information would help.
How did you set up n8n?
Did you follow along the documentation/ set the environment variables?
To use NodeJS modules, you need to set the following environment variables:
export NODE_FUNCTION_ALLOW_BUILTIN=*
export NODE_FUNCTION_ALLOW_EXTERNAL=*
The first is for allowing internal libraries, and the second is for external npm libraries.
Then import the library in your code node, using commonjs syntax.
Ex:
const cheerio = require(βcheerioβ);
Many thanks Akram. This was very helpful, it worked!
Glad it helped!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.