Codex category not able to list in UI

ListCustomNodes.node.ts

import {
INodeExecutionData,
INodeType,
IExecuteFunctions,
INodeTypeDescription,
} from ‘n8n-workflow’;

import * as fs from ‘fs’;
import * as path from ‘path’;

export class ListCustomNodes implements INodeType {
description: INodeTypeDescription = {
displayName: ‘List Custom Nodes’,
name: ‘listCustomNodes’,
group: [‘transform’],
version: 1,
description: ‘Lists all custom nodes available in the system’,
defaults: {
name: ‘List Custom Nodes’,
color: ‘#00AAFF’,
},
inputs: [‘main’],
outputs: [‘main’],
properties: ,

};

async execute(this: IExecuteFunctions): Promise<INodeExecutionData> {
const customNodesDir = path.resolve(__dirname, ‘../../nodes’);
const nodeFolders = fs.readdirSync(customNodesDir).filter((folder) => {
const fullPath = path.join(customNodesDir, folder);
return fs.statSync(fullPath).isDirectory();
});

const returnData = nodeFolders.map((folder) => ({
  json: { customNode: folder },
}));

return [returnData];

}
}

ListCustomNodes.node.json

{
“node”: “n8n-nodes-custom-node.ListCustomNodes”,
“nodeVersion”: “1.0”,
“codexVersion”: “1.0”,
“displayName”: “List Custom Nodes”,
“description”: “Lists all custom nodes available in the system.”,
“categories”: [“Utility”],
“icon”: “fa:list”,
“resources”: {
“credentialDocumentation”: ,
“primaryDocumentation”:
}
}

I am using above code insides C:\Users\1042972\BY\genai-orch-plat-n8n-lowcode\nodes. Not able to see in UI utility category listed

Hi Moderator , Need help deleting a question in this forum.

Hi @priyanka_modanwal

Your code looks fine. When a node doesn’t appear in the UI, the most common reason is that the TypeScript (.ts) file hasn’t been compiled (built) into JavaScript (.js), which is what n8n actually runs.

Follow these three steps to fix it:

Build Your Node: In your terminal, go to your custom node’s directory and run the build command:

npm run build

Check package.json: Make sure the file path in the n8n section correctly points to the compiled file inside the dist folder (e.g., “dist/nodes/ListCustomNodes.node.js”).
Restart n8n: After building the node, you must restart your n8n instance to load the changes.
Forgetting to run npm run build is the most common mistake. This should solve your issue.

If you found this answer helpful, please consider marking it as the solution and giving it a like .

Hi @Websensepro I am pointing out correctly in package.json insides this path dist/nodes/ListCustomNodes.node.js But still not able to see Utility category in UI node search pannel.But custom node is listing there