Problem with require

I notice a problem with require when I try to require some file like this require(“blabla.js”)
or even a different file.
I get the error can’t find the module.
also, there is a problem when I try to install a new package as I said here

the solution that I found for the 2 cases
create side nodejs project install the package that I want to use in n8n, or create new module after that is done, I copy the folder from node_modules in the temp project to n8n node_modules in n8n folder, next I put in n8n folder in package.json in the dependencies the link to the folder, and now I can put require(“moduleNameThatICreated”) in workflow and use the functions that I have\create

this the way it help me to create helper functions

If you’re simply trying to load an external file containing JavaScript, you could use the Read Binary File node to read it.

Imagine a JS file like this:

function foo() {
    return "Hello, World!";

Now it’s possible to execute this function in a workflow like so:

Execute Workflow

This uses eval() which is generally a bad idea for reasons explained in the article.

For your installation trouble with external packages not included in n8n, you might want to follow the thread you have linked.

but the thing is, I don’t want to use any other node more than I have to, I just want to import js file and call functions that is inside of him

You’d need to prepare a custom n8n version in that case including the packages you want to use. But that’s already being discussed in your other thread: Problem with installing packages