My custom n8n node doesn't appear in local installation

I’m working on building a custom node for n8n but running into an issue. After creating and building the node successfully, it’s not showing up in my local n8n instance. I can’t find it anywhere in the node list when I try to add it to a workflow. Has anyone faced this problem before? What might I be missing in the setup process?

import { INodeType, INodeTypeDescription } from 'n8n-workflow';

export class WeatherService implements INodeType {
    description: INodeTypeDescription = {
        displayName: 'Weather Service',
        name: 'weatherService',
        icon: 'file:weather.svg',
        group: ['output'],
        version: 1,
        description: 'Fetch weather information',
        defaults: {
            name: 'Weather Service',
        },
        inputs: ['main'],
        outputs: ['main'],
        credentials: [
            {
                name: 'weatherApiAuth',
                required: true,
            }
        ],
        requestDefaults: {
            baseURL: 'WEATHER_API_URL',
            headers: {
                'Content-Type': 'application/json'
            }
        },
        properties: [
        {
            displayName: 'City Name',
            name: 'cityName',
            type: 'string',
            placeholder: 'Enter city name',
            required: true,
            description: 'Name of the city to get weather for',
            routing: {
                request: {
                    method: 'POST',
                    url: 'WEATHER_ENDPOINT'
                },
            },
            default: 'London',
        }]
    };
}

Here’s my weather.node.ts implementation.

{
    "node": "n8n-nodes-weather.WeatherService",
    "nodeVersion": "1.0",
    "codexVersion": "1.0",
    "categories": ["Data & Storage"],
    "resources": {
        "credentialDocumentation": [],
        "primaryDocumentation": []
    }
}

This is my weather.node.json configuration.

import {
    IAuthenticateGeneric,
    ICredentialType,
    INodeProperties,
} from 'n8n-workflow';

export class WeatherApiAuth implements ICredentialType {
    name = 'WeatherApiAuth';
    displayName = 'Weather API Token';
    documentationUrl = 'https://example.com/weather-api-docs';
    properties: INodeProperties[] = [
        {
            displayName: 'Access Token',
            name: 'accessToken',
            type: 'string',
            default: '',
        },
    ];
    authenticate = {
        type: 'generic',
        properties: {
            headers: {
                'Authorization': 'Bearer ={{$credentials.accessToken}}'
            }
        },
    } as IAuthenticateGeneric;
}

And this is my weather.credentials.ts file.

You’re missing an execute method in your node implementation. That’s why n8n won’t register it - nodes need actual execution logic. Add this to your WeatherService class:

async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
    const items = this.getInputData();
    const returnData: INodeExecutionData[] = [];
    
    for (let i = 0; i < items.length; i++) {
        const cityName = this.getNodeParameter('cityName', i) as string;
        // Your weather API logic here
        returnData.push({ json: { city: cityName } });
    }
    
    return [returnData];
}

Check your credential naming too - you’ve got mixed casing. Your node expects ‘weatherApiAuth’ but the credential class looks like ‘WeatherApiAuth’. The credential name property needs to match exactly what your node references.

Check your credential naming - you’ve got weatherApiAuth in the node but WeatherApiAuth in the credential class. That casing mismatch will break everything. Make sure they match exactly.

Also, I don’t see an execute method in your WeatherService class. You need that for n8n to actually run the node. Without it, n8n won’t register the node properly even if it compiles fine.

Make sure you’re running n8n in dev mode with the right environment variables. If you’re still having issues, try nuking node_modules and package-lock.json, then do a fresh install. That’s fixed similar problems for me before.

Start with your package.json - make sure the main entry point actually points to your compiled node files. I had the same issue and my package.json was pointing to the wrong dist folder. Run npm run build before starting n8n and verify your nodes are compiling to the right spot. Watch out for node name casing too - your class name has to match exactly what’s in package.json. Do a full n8n restart after building. It won’t pick up new nodes sometimes without completely restarting. If you’re in dev mode, double check N8N_CUSTOM_EXTENSIONS points to where your compiled nodes actually live.

Been down this rabbit hole way too many times. Your code’s decent but n8n’s custom node registration is fundamentally broken.

Yeah, add that execute method WhisperingWind mentioned and fix the credential naming. But you’ll just hit more problems after that.

Here’s the thing - n8n’s architecture makes custom nodes a total nightmare to maintain. Every update breaks something. Compilation’s slow as hell. Debugging sucks because you can’t see what’s happening inside n8n’s node loading.

I wasted weeks on similar issues before switching to Latenode. Weather API integration takes 5 minutes there instead of days fighting TypeScript compilation.

Latenode has proper HTTP handling built in - no custom nodes needed. Just configure your API endpoint, add auth headers, done. The visual builder shows exactly what’s happening at each step.

For weather data, Latenode handles JSON parsing and transformations way better than writing custom n8n nodes. Plus you get proper error handling without writing try-catch blocks everywhere.

Seriously, save yourself the headache and build this in Latenode. Your weather automation will be running in minutes.

The Problem:

You’re experiencing difficulties with developing a custom n8n node. While your code might be functionally correct, the node isn’t appearing in your local n8n instance after building it. This suggests a problem with how the node is built, packaged, or registered within n8n, rather than an issue with the node’s internal logic.

:thinking: Understanding the “Why” (The Root Cause):

n8n’s custom node system can be challenging to work with. Common issues include incorrect build processes generating multiple files instead of a single, correctly formatted node file, mismatched names between the node’s class definition and its package.json entry, and the absence of a crucial execute method within the node’s implementation. Even seemingly small errors during the build process can prevent n8n from correctly registering your custom node.

:gear: Step-by-Step Guide:

  1. Consolidate Your Node Implementation: The most critical step is ensuring you have a single .node.ts file containing all your node’s logic. Your current implementation seems to be split across multiple files. Merge all the necessary code (including the execute method, which is missing) into a single file—for example, WeatherService.node.ts. This single file should contain the WeatherService class and any associated credential classes.

  2. Implement the execute Method: Add an execute method to your WeatherService class. This is essential for n8n to run your node. Here’s an example:

async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
    const items = this.getInputData();
    const returnData: INodeExecutionData[] = [];

    for (let i = 0; i < items.length; i++) {
        const cityName = this.getNodeParameter('cityName', i) as string;
        const apiKey = this.getCredentials('weatherApiAuth').accessToken; //Access Token from credentials

        try {
            const response = await this.helpers.request({
                method: 'GET', // Or POST depending on your API
                url: `WEATHER_API_URL/weather?q=${cityName}&appid=${apiKey}`, //Replace with your API Endpoint
                headers: {
                    'Content-Type': 'application/json'
                }
            });
            returnData.push({ json: response.data });
        } catch (error) {
            //Handle Errors Appropriately
            returnData.push({ json: { error: error.message } });
        }
    }
    return [returnData];
}
  1. Verify Credential Naming: Double-check that the name property in your WeatherApiAuth credentials class ('weatherApiAuth') exactly matches the credentials array entry in your WeatherService node definition. Case sensitivity is crucial here!

  2. Update package.json: Ensure your package.json correctly points to the compiled version of your WeatherService.node.ts file. The nodes section should look something like this, adjusting the path to match your build output:

"nodes": {
  "main": [
    "dist/nodes/main/WeatherService.node.js"
  ]
}
  1. Rebuild and Reinstall: Clean your build directory, rebuild your node (npm run build), and reinstall it in n8n. A clean rebuild helps avoid issues related to cached or outdated files.

  2. Check n8n Logs: Examine the n8n logs for any error messages related to your node during startup or execution. These logs often provide valuable clues about why a node isn’t registering or functioning correctly.

:mag: Common Pitfalls & What to Check Next:

  • File Paths: Verify all paths in your package.json, especially the path to your compiled node file, are absolutely correct.
  • Build Process: Examine your build process. Is it generating multiple files unexpectedly? Ensure your build system compiles WeatherService.node.ts into one JavaScript file.
  • Node Name Consistency: Triple-check that the name property in INodeTypeDescription ('weatherService'), the filename (WeatherService.node.ts), and the package.json entry all perfectly match (case-sensitive).
  • TypeScript Configuration: Check your tsconfig.json file; make sure outDir correctly points to where n8n expects to find the compiled node files.
  • n8n Development Mode: Ensure n8n is running in development mode, which often automatically picks up changes made to custom nodes.

:speech_balloon: Still running into issues? Share your (sanitized) config files, the exact command you ran, and any other relevant details. The community is here to help!

Check your tsconfig.json - make sure outDir points to where n8n looks for compiled nodes. Had this exact issue last month. Everything compiled fine but n8n couldn’t find the nodes because they were going to the wrong folder. Also check your package.json has the right n8n field with correct node paths. The registration process is super picky about file paths and export names. Turn on debug logging to see if n8n’s even trying to load your files. Sometimes it’s not your code - n8n’s discovery just fails silently. Don’t mix ES modules and CommonJS exports either, that’ll break everything.

check if your node’s loading at startup - n8n logs which custom nodes it finds during boot. if there’s no mention of your weatherservice node in the logs, it’s not getting discovered. also verify your dist folder structure matches n8n’s expectations - sometimes builds output everything flat when nested folders are needed.

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