# Custom node not appear in the category

**URL:** <https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173>\
**Category:** Developing Nodes\
**Created:** [20 June 2022 14:59 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173 "2022-06-20T14:59:25Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuad\_rock](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fuad\_rock](https://discourse.nodered.org/u/fuad_rock)\
**Post date:** [20 June 2022 14:59 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/1 "2022-06-20T14:59:25Z")

</div>

Hi, I have created a custom node and installed it in nodered. It appears in manage-pallette but not in the category.

my package.json

```auto
{
    "name" : "node-red-contrib-simulation-quantity-add",
    
    "node-red" : {
        "nodes": {
            "quantity-add": "quantity-add.js"
        }
    }
}

```

quantity-add.html:

```auto
<script type="text/javascript">
    RED.nodes.registerType('quantity-add',{
        category: 'function',
        color: '#a6bbcf',
        defaults: {
            name: {value:""},
            type: {value:""}
        },
        inputs:1,
        outputs:1,
        icon: "file.png",
        label: function() {
            return this.name||"quantity-add";
        }
    });

</script>

<script type="text/html" data-template-name="quantity-add">
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
    </div>
    <div class="form-row">
        <label for="node-input-type"><i class="fa fa-tag"></i> Quantity type</label>
        <input type="text" id="node-input-type" placeholder="Type">
    </div>
</script>

<script type="text/html" data-help-name="quantity-add">
    <p>A digitalTwin simulation's custom node for adding quantity</p>
</script>

```

quantity-add.js :

```auto
module.exports = function (RED) {
    function QuantityAddNode(config) {
        RED.nodes.createNode(this, config);
        var node = this;

        var type = config.Type;

        node.on('input', function (msg) {
     
            node.send(type);
        });
    }
    RED.nodes.registerType("quantity-add", QuantityAddNode);
}

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 June 2022 15:01 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/2 "2022-06-20T15:01:36Z")

</div>

> [@fuad\_rock](#):
>
> It appears in manage-pallette but not in the category.

where does it appear then - please show or explain

---

<div class="post-metadata">

**Author:** ![fuad\_rock](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fuad\_rock](https://discourse.nodered.org/u/fuad_rock)\
**Post date:** [20 June 2022 15:04 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/3 "2022-06-20T15:04:16Z")

</div>

![cate](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7dbedf85ffe74fa19e06a1e23afcd0447c13aa07.png)  
 ![palate](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b88872150ca301657829beafdf7c4719342f2de8.png)

As you can see its installed successfully but does not appear in the function category

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 June 2022 15:10 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/4 "2022-06-20T15:10:06Z")

</div>

How is the node installed - from NPM? or from symlink or other? Was it a `--global` install?

If symlinked in `node_modules`...

- ensure modifications are changed
- restart node-red
- try refreshing (hard cache clearing refresh)
- try searching the left hand palette for `quantity`

---

<div class="post-metadata">

**Author:** ![fuad\_rock](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fuad\_rock](https://discourse.nodered.org/u/fuad_rock)\
**Post date:** [20 June 2022 15:18 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/5 "2022-06-20T15:18:01Z")

</div>

npm install C:\Users\golamk.node-red\custom\quantity-add

---

<div class="post-metadata">

**Author:** ![fuad\_rock](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fuad\_rock](https://discourse.nodered.org/u/fuad_rock)\
**Post date:** [22 June 2022 13:28 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/6 "2022-06-22T13:28:00Z")

</div>

I tried all of the suggestions but they didn't work for me

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [22 June 2022 13:53 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/7 "2022-06-22T13:53:14Z")

</div>

Maybe you can try:  
`npm pack` within your projects root folder, then upload the result using the upload module function?

Might be worth taking it out of Node RED first?  
The only factor I can see is the method of install.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9adee56c5d7e160a358ef5f096d683a7a75a7531.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 June 2022 14:18 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/8 "2022-06-22T14:18:08Z")

</div>

- Are there any errors in the node-red console when you start node-red?
- Try adding a palletLabel property to the node
- Have you tried the search box in the palette?
- What if you set a different category?
- Are there any errors in the browser console?
- Try adding `console.log("hi from my node, I am just above RED.nodes.registerType('quantity-add'...")` and `console.log("hi from my node, I am inside the label() function")`
- where is `quantity-add.js` in relation to `package.json`?

---

<div class="post-metadata">

**Author:** ![fuad\_rock](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fuad\_rock](https://discourse.nodered.org/u/fuad_rock)\
**Post date:** [29 June 2022 08:08 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/9 "2022-06-29T08:08:20Z")

</div>

console.log doesn't work and I'm getting an error "BAIL on node-red-contrib-quantity-add/quantity-add

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/f/2fafa5ffb79f7da779d80f7e17cc4dd67ca0f5e2.png)  
"

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 June 2022 10:12 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/10 "2022-06-29T10:12:03Z")

</div>

Lets approach this with some basics.

1. **Your modules folder should be structured as follows.**

**Note** : Its a personal choice, that I put the guts of the package In a `nodes` folder, but I (don't think) its a requirement - as long as `package.json` correctly references the location of the main entry point.

The `icons` folder, should be in the same location as your `html` & `js` file

- quantity-add (dir)
  - package.json
  - nodes (dir)
    - quantity-add.js
    - quantity-add.html
    - icons
      - file.png (based on your html file)

1. **Your package.json file**

```auto
{
    "name" : "node-red-contrib-simulation-quantity-add",
    "version": "0.0.1",
    "engines": {
		"node": ">=12.22.2"
	},
    "node-red" : {
        "nodes": {
            "quantity-add": "nodes/quantity-add.js"
        }
    }
}

```

if all this checks out, within your packages directory (in my example above that will be `quantity-add`)  
run `npm pack` and upload it via the User Interface.

(once again - it may be better to remove any trace of it thus far from node red)  
The only thing that is sticking out at me, is your method of install.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 June 2022 10:18 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/11 "2022-06-29T10:18:07Z")

</div>

> [@marcus-j-davies](#):
>
> The only thing that is sticking out at me, is your method of install

No, that is how I always install my dev node packages. I have multiple ones installed right now.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 June 2022 10:19 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/12 "2022-06-29T10:19:32Z")

</div>

Does it work for sub folders?

```auto
npm install C:\Users\golamk\.node-red\custom\quantity-add
                                         ^

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 June 2022 10:21 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/13 "2022-06-29T10:21:14Z")

</div>

```auto
  "dependencies": {
    "@node-red-contrib-themes/theme-collection": "^2.2.0",
    "@totallyinformation/node-red-experimental-nodes": "file:../../node-red-experimental-nodes",
    "chokidar": "^3.5.3",
    "collection-red": "~0.0.5",
    "csv-parser": "^3.0.0",
    "ejs": "^3.1.6",
    "fast-glob": "^3.2.11",
    "fs-extra": "^10.0.1",
    "googleapis": "^39.2.0",
    "mqtt": "^4.2.8",
    "node-drayton-wiser": "file:../../node-drayton-wiser",
    "node-red-contrib-cron-plus": "~1.5.4",
    "node-red-contrib-events": "file:../../node-red-contrib-events",
    "node-red-contrib-jktesting": "file:../../node-red-contrib-jktesting",
    "node-red-contrib-simple-gate": "~0.5.2",
    "node-red-contrib-telegrambot": "~11.3.0",
    "node-red-contrib-uibuilder": "file:../../node-red-contrib-uibuilder",
    "node-red-dashboard": "~3.1.7",
    "node-red-node-discord": "~2.2.0",
    "node-red-node-random": "~0.4.0",
    "node-red-node-sqlite": "~1.0.3",
    "red-contrib-drayton-wiser": "file:../../node-red-contrib-drayton-wiser",
    "wmi-client": "^0.5.0"
  },

```

The install is done as `npm install c:\src\node-red-contrib-drayton-wiser`, npm changes it to a relative file path.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 June 2022 10:24 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/14 "2022-06-29T10:24:16Z")

</div>

Cool.

I usually pack during development - so wasn't sure if sub level folders were an issue in windows.  
I don't use windows 😅

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 June 2022 10:25 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/15 "2022-06-29T10:25:24Z")

</div>

> [@marcus-j-davies](#):
>
> I usually pack during development - so wasn't sure if sub level folders were an issue in windows

No, it is fine and means that you only need to restart node-red if there is a change to the source. I do that automatically via PM2 with defined watch folders.

I develop on Windows and run on Linux.

🙂

Also, slight update to your package.json example. It should include an "engines" property to show the minimum version of node.js supported.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 June 2022 10:31 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/16 "2022-06-29T10:31:36Z")

</div>

> Also, slight update to your package.json example. It should include an "engines" property to show the minimum version of node.js supported.

Yup - I also, Copy and paste job from this discussion 😅

edited

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 August 2022 10:31 UTC](https://discourse.nodered.org/t/custom-node-not-appear-in-the-category/64173/17 "2022-08-28T10:31:44Z")

</div>

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