Help! My custom n8n node is MIA
I just finished making a custom node for n8n. I thought I did everything right, but when I fire up my local n8n instance, my new node is nowhere to be found. What gives?
Here’s a simplified version of what I’ve got:
import { INodeType, INodeTypeDescription } from 'n8n-workflow';
export class CustomHelper implements INodeType {
description: INodeTypeDescription = {
displayName: 'Custom Helper',
name: 'customHelper',
icon: 'file:helper.svg',
group: ['utility'],
version: 1,
description: 'Sends a message to CustomHelper',
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'helperApi',
required: true
}
],
properties: [
{
displayName: 'Query',
name: 'query',
type: 'string',
required: true,
default: ''
}
]
};
}
Any ideas on what I might be missing or doing wrong? Thanks in advance!
hey there! make sure ur node is in the right folder (usually /nodes) and that u’ve rebuilt n8n after adding it. also, double-check ur package.json to see if the node is listed in the n8n.nodes section. if none of that works, try restarting n8n completely. hope this helps!
I’ve been through this exact situation before, and it can be frustrating! One thing that tripped me up was forgetting to export the node properly. Make sure you have an ‘index.ts’ file in your node’s directory that exports the node class. It should look something like this:
import { CustomHelper } from './CustomHelper';
export {
CustomHelper
};
Also, don’t forget to run ‘npm run build’ after making changes. If you’re using n8n in development mode, you might need to restart the n8n process for changes to take effect.
Lastly, check your n8n configuration. Sometimes, the path to custom nodes needs to be explicitly set. You can do this by setting the N8N_CUSTOM_EXTENSIONS environment variable or modifying your config file.
If none of these work, try creating a simple ‘hello world’ node first to isolate the issue. Good luck!
It seems you’ve crafted the node structure correctly, but there are a few additional steps to ensure it appears in your local n8n instance. First, verify that you’ve placed the node file in the correct directory, typically ‘/nodes’. Next, update your ‘package.json’ file to include the node in the ‘n8n.nodes’ section. After making these changes, rebuild n8n and restart your local instance. If issues persist, check your n8n logs for any error messages related to node loading. Sometimes, syntax errors or missing dependencies can prevent a node from appearing. Lastly, ensure you’ve followed n8n’s documentation for custom node development, as there might be version-specific requirements or additional configuration steps needed.