Installing Custom Node

Hi, I am self hosting an n8n instance. I wanted to know how I could install a custom node in my n8n and also have no issues when updating in future.

Also I wanted to try that in the desktop version too.

Thanks

Hey @zocket, the suggested approach is described here: Creating n8n-nodes-module | Docs (in the “Use the n8n-nodes-module in production” section).

For the desktop version I think you can head to the node_modules folder of your app (the full path would be C:\Users\<USERNAME>\AppData\Local\Programs\n8n\resources\app\node_modules if you’re using Windows) and run the npm install command from the aformentioned doc in there (you’d need to have Node.js & npm installed for that, of course).

Hey @MutedJam (or another n8n-member in this regard), I’m trying to do something similar.
Currently I’m hosting n8n locally via npm, included even some custom nodes and everything works fine.
Now I want to do the same with the Windows desktop application (include my custom nodes).
I followed @MutedJam 's approach, went to the folder location they recommended and tried to run the commands stated in the link (npm install, npm run build, npm link).
But when I run “npm run build” it just says that there is no script for “build”.
Where does the command find the package.json file to run “build”? Following the path there is none in the directory.
Any help or directions would be appreciated!

So the linked page suggest running git clone https://github.com/n8n-io/n8n-nodes-starter.git n8n-nodes-weather. This command clones the repository into a folder named n8n-nodes-weather. You would need to change into this very folder (using cd n8n-nodes-weather) and should be able to execute the npm install and npm run build commands in there.

That said, I know some folks are planning a live session on building nodes and workflows. I think the exact details aren’t fully ironed out yet, but you might want to keep an eye on n8n’s social media channels or this forum :slight_smile:

If you simply want to install an existing custom node, this will be possible very soon right through the UI, no additional commands required.

I see!
Thank you for the quick response :slight_smile:
I will get to it as you suggested
then.

well that was bs

I’ve an n8n instance installed via docker compose and the official docs only show a way to add a private node by creating a dockerfile. So I’d need to create a dockerfile and change my dockercompose to extend from that build, except that sounds like a lot of work that could also break my current environment just for adding a node, specially when it was supposed to be ITW that one could do this via the UI… please point me in the right direction

It has changed, that doesn’t make it bs.

You can pay for premium npm then you can host private packages. Then they still works by adding in the GUI as long as the naming convention is right (at least this was true last time I did it)

If you don’t want to give npm your money, I wouldn’t blame you. You can change it to another registry using the env var N8N_COMMUNITY_PACKAGES_REGISTRY, but for that I believe you need to have licence key.

The great thing about docker is that if it works once it will (usually) always work the same. Custom docker files really aren’t that tough, once you figure it out it’s only the inconvenience of needing to wait for a build instead of waiting for a download

I get it, it’s just frustrating when there’s conflicting information, and the docs don’t help solve that confussion.

Seems like I’ll need to go the Dockerfile way, I just had a hard time getting the compose to work properly so am a bit concerned of breaking the deployment/losing the workflows so I need to make backups and recover if it doesn’t work etc… just seems like a lot.

Thank you for clarifying.