# Can not install external nodes in embedding mode

**URL:** <https://discourse.nodered.org/t/can-not-install-external-nodes-in-embedding-mode/5489>\
**Category:** General\
**Created:** [5 December 2018 03:05 UTC](https://discourse.nodered.org/t/can-not-install-external-nodes-in-embedding-mode/5489 "2018-12-05T03:05:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kilik52](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kilik52/32/4276_2.png) [@kilik52](https://discourse.nodered.org/u/kilik52)\
**Post date:** [5 December 2018 03:05 UTC](https://discourse.nodered.org/t/can-not-install-external-nodes-in-embedding-mode/5489/1 "2018-12-05T03:05:33Z")

</div>

Hi there,

i'm new to nodered. I followed the documents about embedding nodered in an express app, and it worked.

My settings:

```auto
var settings = {
  httpAdminRoot: "/red",
  httpNodeRoot: "/redapi",
  userDir: "~/.node-red/",
  functionGlobalContext: {} // enables global context
};

```

But when i tried to install external nodes in nodered userDir using:

```auto
npm install node-red-contrib-mongodb

```

the installed node did not show in the panel.

When i tried to install using menu, it reports an error:

 ![30](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4365a479d1b9c5f5e5479e6966553c02b79c5928.png)

The express console reported this error:

```auto
5 Dec 11:01:29 - [info] Installing module: node-red-contrib-mongodb, version: 0.3.4
5 Dec 11:01:34 - [info] Installed module: node-red-contrib-mongodb
POST /red/nodes 400 5281.048 ms - 86

```

I did some digging, and found the exact error is:

```auto
{ Error: Cannot find module 'node-red-contrib-mongodb'
    at Object.getModuleFiles (/Users/zhuxichi/Documents/GitHub/kgserver_v2/node_modules/node-red/red/runtime/nodes/registry/localfilesystem.js:350:19)
    at Object.addModule (/Users/zhuxichi/Documents/GitHub/kgserver_v2/node_modules/node-red/red/runtime/nodes/registry/loader.js:395:43)
    at Object.addModule (/Users/zhuxichi/Documents/GitHub/kgserver_v2/node_modules/node-red/red/runtime/nodes/registry/index.js:41:19)
    at ChildProcess.child.on (/Users/zhuxichi/Documents/GitHub/kgserver_v2/node_modules/node-red/red/runtime/nodes/registry/installer.js:140:52)
    at ChildProcess.emit (events.js:182:13)
    at ChildProcess.EventEmitter.emit (domain.js:442:20)
    at maybeClose (internal/child_process.js:961:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5) code: 'MODULE_NOT_FOUND' }

```

It's quite weird because there is no problem when i use a standalone node-red instance. Anything wrong with my settings?

---

<div class="post-metadata">

**Author:** ![kilik52](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kilik52/32/4276_2.png) [@kilik52](https://discourse.nodered.org/u/kilik52)\
**Post date:** [5 December 2018 03:11 UTC](https://discourse.nodered.org/t/can-not-install-external-nodes-in-embedding-mode/5489/2 "2018-12-05T03:11:13Z")

</div>

Oh, I tried calling npm install in my project root dir and it seems worked.
