Using require() in a function node

Hello,

Describe the problem/error/question

In order to do the login authentication for a program I need to use/paste a file (psrApi.js), this file however users methods like require() and is in need of the module ‘babel-polyfill’… is there a way I can integrate this provided script into my workflow? Because in a next step (the actual authentication code) I will need to make references like psrApi.Authenticate

How will I be able to properly integrate the script? Is there a possibility to use something like the Execute Command node such that I can import the missing functions or the file with its functionalities?

What is the error message (if any)?

Cannot find module ‘babel-polyfill’ [line 1]

Please share your workflow

As of now it is just a Code node where I pasted in the psrApi.js file

Information on your n8n setup

  • n8n version: 1.98.1 Self Hosted
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via: Docker:
  • Operating system: Linux Ubuntu

Hi @sharon, you can refer to this post that talk about your question.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.