# Creating a node with dependency

**URL:** <https://discourse.nodered.org/t/creating-a-node-with-dependency/6650>\
**Category:** General\
**Created:** [10 January 2019 07:20 UTC](https://discourse.nodered.org/t/creating-a-node-with-dependency/6650 "2019-01-10T07:20:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuzmich](https://avatars.discourse-cdn.com/v4/letter/k/3be4f8/32.png) [@kuzmich](https://discourse.nodered.org/u/kuzmich)\
**Post date:** [10 January 2019 07:20 UTC](https://discourse.nodered.org/t/creating-a-node-with-dependency/6650/1 "2019-01-10T07:20:15Z")

</div>

Hello, i'm new to Node-Red, and i'm trying to make a new node which is dependent on another module. Simply put, i'm trying to use the module (which works fine in pure Node) in Node-Red, but i'm getting an error "Waiting for missing types to be registered:" . I listed the original module as dependency in package.json (before this error was "unknown module").

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 January 2019 07:32 UTC](https://discourse.nodered.org/t/creating-a-node-with-dependency/6650/2 "2019-01-10T07:32:54Z")

</div>

The easiest if probably to look to see how other nodes do it. Try looking at the node-red github pages

---

<div class="post-metadata">

**Author:** ![kuzmich](https://avatars.discourse-cdn.com/v4/letter/k/3be4f8/32.png) [@kuzmich](https://discourse.nodered.org/u/kuzmich)\
**Post date:** [10 January 2019 07:41 UTC](https://discourse.nodered.org/t/creating-a-node-with-dependency/6650/3 "2019-01-10T07:41:18Z")

</div>

With all respect, it is definitely not the easiest because i don't know which part of the package is responsible for the error.

---

<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:** [10 January 2019 07:46 UTC](https://discourse.nodered.org/t/creating-a-node-with-dependency/6650/4 "2019-01-10T07:46:14Z")

</div>

If the runtime has failed to load your node there will be an error in the Node-RED log at startup. That's your starting point for identifying the underlying issue.

To use another npm module in your node you need to include it in the dependencies section of its package.json file and remember to run `npm install` in the node's directory to actually get it installed.

---

<div class="post-metadata">

**Author:** ![kuzmich](https://avatars.discourse-cdn.com/v4/letter/k/3be4f8/32.png) [@kuzmich](https://discourse.nodered.org/u/kuzmich)\
**Post date:** [11 January 2019 02:25 UTC](https://discourse.nodered.org/t/creating-a-node-with-dependency/6650/5 "2019-01-11T02:25:06Z")

</div>

Many thanks. Everything is working now.  
Turns out i have to install the original package not only in the node-red directory, but also in the new package directory. Interesting, but i have one more question now. After installation, i now have 65 packages in node\_modules subdir of new module directory. Is it normal?

---

<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:** [11 January 2019 07:45 UTC](https://discourse.nodered.org/t/creating-a-node-with-dependency/6650/6 "2019-01-11T07:45:55Z")

</div>

> [@kuzmich](#):
>
> Turns out i have to install the original package not only in the node-red directory, but also in the new package directory

I suspect you only need it to install it in the new package directory.
