Build many custom node

Hello,

I have to for my company create many custom nodes, I followed this part :

It’s work for one or two etc… custom node in same folder when I build and launch n8n, but if I want organize my main folder with one folder by custom node, I have to build by each folder and after that I can launch n8n, is it not possible to build in one time all sub-folder ?

Thank you

Hey @damien_al!

Welcome to the community :sparkling_heart:

Can you please elaborate on what do you mean by

is it not possible to build in one time all sub-folder ?

You create the nodes and then build n8n. It will build all the nodes together.

Hello @harshil1712 ,

I use " Node Dev CLI" to create custom node with n8n installing general mode.

The doc say :

  1. Build the node and copy to correct location: n8n-node-dev build That command will build the JavaScript version of the node from the TypeScript code and copy it to the user folder where custom nodes get read from ~/.n8n/custom/
  2. Restart n8n and refresh the window so that the new node gets displayed

When it’s

  • mainFolder
    • CustomNode1.node.ts
    • CustomAPi1.credentials.ts
    • CustomNode2.node.ts
    • CustomAPi2.credentials.ts

it’s work but when I try :

  • mainFolder
    • subFolder1
      • CustomNode1.node.ts
      • CustomAPi1.credentials.ts
    • subFolder2
      • CustomNode2.node.ts
      • CustomAPi2.credentials.ts

The build not working

Hey @damien_al,

The tool currently doesn’t support building nodes in the sub-folder. You will have to have them in a single folder (the mainFolder) or create nodes packages (eg: GitHub - n8n-io/n8n-nodes-starter: Example starter module for custom n8n nodes.).

If you plan to create node packages, you will have to install them alongside n8n to use them. You can find more information on that here: Using the Node Dev CLI | Docs

1 Like

All right, thanks @harshil1712

1 Like

Let us know which approach you take and if you face any issue, feel free to ask us on the forum :slight_smile: