# How to install node types?

**URL:** <https://discourse.nodered.org/t/how-to-install-node-types/77522>\
**Category:** General\
**Created:** [13 April 2023 10:15 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522 "2023-04-13T10:15:22Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [13 April 2023 10:15 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/1 "2023-04-13T10:15:22Z")

</div>

Hello,

I'm new to node-red, and I need help with installing node types.  
When I run the project it says:

```auto
Flows stopped due to missing node types.
sf:3f24e8e108a6d3cc
sf:827ff8967a4e86f6

```

And I have them in separate folder, in main project folder (.node-red), in package.json I have included them(setworkmode and uimonad).

```auto
{
    "name": "node-red-project",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
        "node-red-contrib-bigexec": "~1.3.3",
        "node-red-contrib-modbus": "~5.23.1",
        "node-red-contrib-ui-contextmenu": "~2.0.1",
        "node-red-contrib-ui-led": "~0.4.11",
        "node-red-contrib-ui-multistate-switch": "~1.2.3",
        "node-red-dashboard": "~3.1.7",
        "setworkmode": "file:../subflowModules/setworkmode",
        "uimonad": "file:../subflowModules/uimonad"
    }
}

```

Inside those 2 folders(setworkmode and uimonad) are index.js, package.json and subflow.json that former colleague has created.

And in CMD it says:

````auto
13 Apr 12:16:20 - [info] Waiting for missing types to be registered:
13 Apr 12:16:20 - [info] - sf:3f24e8e108a6d3cc
13 Apr 12:16:20 - [info] - sf:827ff8967a4e86f6```
````

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 April 2023 10:18 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/2 "2023-04-13T10:18:15Z")

</div>

Have you run `npm install` since adding them to `package.json`? You need to do that to get npm to create the necessary symlnks from `/.node-red/node_modules` to where the nodes are.

---

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [13 April 2023 10:20 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/3 "2023-04-13T10:20:25Z")

</div>

I have, but i get this:

```auto
C:\Users\Marko>npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Marko/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Marko\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Marko\AppData\Local\npm-cache\_logs\2023-04-13T10_18_48_898Z-debug-0.log

```

---

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [13 April 2023 10:24 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/4 "2023-04-13T10:24:37Z")

</div>

I'm not 100% sure where files need to be located.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 April 2023 10:27 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/5 "2023-04-13T10:27:09Z")

</div>

You need to run `npm install` in the same directory as your `package.json` file - `.node-red`

---

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [13 April 2023 10:54 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/6 "2023-04-13T10:54:15Z")

</div>

I did it like this:

```auto
C:\Users\Marko>npm install C:\Users\Marko\.node-red

removed 151 packages, changed 2 packages, and audited 164 packages in 4s

20 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (4 moderate, 3 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues, run:
  npm audit fix --force

Run `npm audit` for details.

```

But now I don't have any other nodes in palette except node-red and setworkmode, and more of the nodes in the project are red line dashed

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 April 2023 11:45 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/7 "2023-04-13T11:45:37Z")

</div>

> [@\_Markus](#):
>
> I did it like this:
> 
> ```auto
> C:\Users\Marko>npm install C:\Users\Marko\.node-red
> 
> ```

That is not what I said to do.

You should run `npm install` from in the directory `C:\Users\Marko\.node-red`

```auto
cd C:\Users\Marko\.node-red
npm install

```

---

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [13 April 2023 11:54 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/8 "2023-04-13T11:54:36Z")

</div>

I did it like that now, but I'm still missing uimonad node in palette

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 April 2023 14:39 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/9 "2023-04-13T14:39:44Z")

</div>

What is in package.json?

---

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [13 April 2023 16:49 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/10 "2023-04-13T16:49:16Z")

</div>

In uimonad package.jason is:

```auto
{
  "name": "uimonad",
  "version": "1.0.0",
  "description": "Ensure UI text reacts to errors and fetch prompts.",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "monad",
    "error",
    "init",
    "ui"
  ],
  "author": "Toni Opuhač",
  "license": "ISC",
  "node-red": {
    "nodes": {
      "uimonad": "index.js"
    },
    "dependencies": [
      "node-red-contrib-bigexec",
      "node-red-contrib-modbus",
      "node-red-contrib-ui-contextmenu",
      "node-red-contrib-ui-led",
      "node-red-contrib-ui-multistate-switch",
      "node-red-dashboard"
    ]
  },
  "dependencies": {
    "node-red-contrib-bigexec": "~1.3.3",
    "node-red-contrib-modbus": "~5.23.1",
    "node-red-contrib-ui-contextmenu": "~2.0.1",
    "node-red-contrib-ui-led": "~0.4.11",
    "node-red-contrib-ui-multistate-switch": "~1.2.3",
    "node-red-dashboard": "^3.4.0"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 April 2023 16:59 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/11 "2023-04-13T16:59:05Z")

</div>

As you can see, that is messed up. It may have been the incorrect npm install that you did earlier that caused that. Fix that, then I may be wrong, but I don't think it is a good idea to put the linked nodes under the .node-red folder, I think I had problems doing that at some point. Move them out to separate folders and remove those entries from package.json. Then to get the subflowmodules installed, go into the .node-red folder and run  
`npm install /path/to/subflowModules/setworkmode`  
and the same for the other one. Then restart node red.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 April 2023 21:04 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/12 "2023-04-13T21:04:20Z")

</div>

If you are not sure how to fix package.json then delete it and the node\_modules folder. Then restart node-red. It will complain that there are missing nodes. Install those again, which you can do from inside node-red, then manually install your nodes as described above and restart node-red.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [14 April 2023 01:08 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/13 "2023-04-14T01:08:53Z")

</div>

Category changed to general as the post is not about "developing nodes" 😀

---

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [14 April 2023 08:58 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/14 "2023-04-14T08:58:06Z")

</div>

Could you explain to me from start, so 0, I just opened new project and I only want to install for example setworkmode node type, how do you do that? Things that I have are only folder setworkmode and inside are files:  
index.js

```auto
 const fs = require("fs");
 const path = require("path");

 module.exports = function(RED) {
     const subflowFile = path.join(__dirname,"subflow.json");
     const subflowContents = fs.readFileSync(subflowFile);
     const subflowJSON = JSON.parse(subflowContents);
     RED.nodes.registerSubflow(subflowJSON);
 }

```

package.json

```auto
{
  "name": "setworkmode",
  "version": "1.0.0",
  "description": "Set work mode of leCPS.",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "leCPS",
    "work",
    "mode",
    "set"
  ],
  "author": "Toni Opuhač",
  "license": "ISC",
  "node-red": {
    "nodes": {
      "Set work mode state": "index.js"
    },
    "dependencies": [
        "node-red-contrib-bigexec",
        "node-red-contrib-modbus",
        "node-red-contrib-ui-contextmenu",
        "node-red-contrib-ui-led",
        "node-red-contrib-ui-multistate-switch",
        "node-red-dashboard",
        "uimonad"
    ]
  },
  "dependencies": {
        "node-red-contrib-bigexec": "~1.3.3",
        "node-red-contrib-modbus": "~5.23.1",
        "node-red-contrib-ui-contextmenu": "~2.0.1",
        "node-red-contrib-ui-led": "~0.4.11",
        "node-red-contrib-ui-multistate-switch": "~1.2.3",
        "node-red-dashboard": "~3.1.7",
        "uimonad": "file:../subflowModules/uimonad"
  }
}

```

subflow.json

```auto
{
"id": "827ff8967a4e86f6",
"type": "subflow",
"name": "Set work mode state",
"info": "",
"category": "function",
"in": [
    {
	"x": 40,
	"y": 140,
	"wires": [
	    {
		"id": "7056865d556523f1"
	    }
	]
    }
],
"out": [
    {
	"x": 750,
	"y": 140,
	"wires": [
	    {
		"id": "352ddb6a0cdcfbab",
		"port": 0
	    },
	    {
		"id": "c348f6c2462bd906",
		"port": 0
	    },
	    {
		"id": "ca9ca3c8f60b1653",
		"port": 0
	    },
	    {
		"id": "8e980d04beae8cd6",
		"port": 0
	    }
	]
    }
],
"env": [],
"meta": {},
"color": "#FFAAAA",
"inputLabels": [
    "CPS modbus payload"
],
"outputLabels": [
    "Colored text representing state"
],
"icon": "node-red/swap.svg",
"flow": [
    {
        "id": "352ddb6a0cdcfbab",
        "type": "template",
        "z": "827ff8967a4e86f6",
        "name": "Set state local-automatic",
        "field": "payload",
        "fieldType": "msg",
        "format": "json",
        "syntax": "mustache",
        "template": "{\n \"color\": \"brown\",\n \"valueText\": \"Trenutno stanje lokalnog-automatskog upravljanja\"\n}",
        "output": "json",
        "x": 470,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "c348f6c2462bd906",
        "type": "template",
        "z": "827ff8967a4e86f6",
        "name": "Set state remote",
        "field": "payload",
        "fieldType": "msg",
        "format": "json",
        "syntax": "mustache",
        "template": "{\n \"color\": \"blue\",\n \"valueText\": \"Trenutno stanje daljinskog načina upravljanja\"\n} ",
        "output": "json",
        "x": 440,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "ca9ca3c8f60b1653",
        "type": "template",
        "z": "827ff8967a4e86f6",
        "name": "Set state local",
        "field": "payload",
        "fieldType": "msg",
        "format": "json",
        "syntax": "mustache",
        "template": "{\n \"color\": \"green\",\n \"valueText\": \"Trenutno stanje lokalnog načina upravljanja\"\n}",
        "output": "json",
        "x": 440,
        "y": 160,
        "wires": [
            []
        ]
    },
    {
        "id": "8e980d04beae8cd6",
        "type": "template",
        "z": "827ff8967a4e86f6",
        "name": "Set state undefined",
        "field": "payload",
        "fieldType": "msg",
        "format": "json",
        "syntax": "mustache",
        "template": "{\n \"color\": \"purple\",\n \"valueText\": \"Trenutno stanje nije ispravno definirano\"\n}",
        "output": "json",
        "x": 450,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "7056865d556523f1",
        "type": "switch",
        "z": "827ff8967a4e86f6",
        "name": "Check work mode state",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "0",
                "vt": "num"
            },
            {
                "t": "eq",
                "v": "1",
                "vt": "num"
            },
            {
                "t": "eq",
                "v": "2",
                "vt": "num"
            },
            {
                "t": "eq",
                "v": "3",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 4,
        "x": 210,
        "y": 140,
        "wires": [
            [
                "352ddb6a0cdcfbab"
            ],
            [
                "c348f6c2462bd906"
            ],
            [
                "ca9ca3c8f60b1653"
            ],
            [
                "8e980d04beae8cd6"
            ]
        ]
    }
]
}

```

Where do I need to put that folder and what do I need to type and where? Step-by-step please, I'm just starting so I don't know much.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 April 2023 09:03 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/15 "2023-04-14T09:03:19Z")

</div>

> [@\_Markus](#):
>
> I only want to install for example setworkmode node type

Firstly, do not manually edit package.json. If you have already done that then start again.

To install your node, in a command window, `cd` to your .node-red folder and, as I said above, run  
`npm install /path/to/your/node`  
then restart node-red.  
I also said that I think I have had problems if the node is under the .node-red folder so it may be best to move it out of there.

---

<div class="post-metadata">

**Author:** ![\_Markus](https://avatars.discourse-cdn.com/v4/letter/_/ecb155/32.png) [@\_Markus](https://discourse.nodered.org/u/_Markus)\
**Post date:** [14 April 2023 09:14 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/16 "2023-04-14T09:14:03Z")

</div>

Thank you soo much, it worked

---

<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 April 2023 09:14 UTC](https://discourse.nodered.org/t/how-to-install-node-types/77522/17 "2023-04-28T09:14:46Z")

</div>

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