# Adding an external github module to a function node

**URL:** <https://discourse.nodered.org/t/adding-an-external-github-module-to-a-function-node/61275>\
**Category:** General\
**Created:** [14 April 2022 08:53 UTC](https://discourse.nodered.org/t/adding-an-external-github-module-to-a-function-node/61275 "2022-04-14T08:53:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davec1001](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davec1001](https://discourse.nodered.org/u/davec1001)\
**Post date:** [14 April 2022 08:53 UTC](https://discourse.nodered.org/t/adding-an-external-github-module-to-a-function-node/61275/1 "2022-04-14T08:53:33Z")

</div>

Hi,

I can easily and conveniently add an npm module to a function node.

Is it possible to use a github version of a module?

David

---

<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:** [14 April 2022 09:22 UTC](https://discourse.nodered.org/t/adding-an-external-github-module-to-a-function-node/61275/2 "2022-04-14T09:22:33Z")

</div>

Not directly.

I haven't done it before but you could try installing the module from github using the the NPM CLI then try importing it.

e.g..

```auto
cd ~/.node-red
npm install https://github.x.y.z

```

Please let us know if you try and if it works 🙂

---

<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:** [14 April 2022 11:57 UTC](https://discourse.nodered.org/t/adding-an-external-github-module-to-a-function-node/61275/3 "2022-04-14T11:57:38Z")

</div>

Doesn't appear to work unfortunately. Doesn't seem to use the GitHub prefix in the way that npm itself does.

Would be a good feature request I think.

---

<div class="post-metadata">

**Author:** ![davec1001](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davec1001](https://discourse.nodered.org/u/davec1001)\
**Post date:** [14 April 2022 12:22 UTC](https://discourse.nodered.org/t/adding-an-external-github-module-to-a-function-node/61275/4 "2022-04-14T12:22:14Z")

</div>

Steve's suggestion worked though 'I think' it's quite intricate to be sure -🙂

My situation was as follows -:

- Created two repos -: Module1-Node-red and Module2. Module1-Node-red depended on Module2. (Module2 existed on NPM but I had modified)

- Then added Module2 to a function.

- When I restarted node-red Module2 was overwritten to become the npm version.

I think using Steves approach of add module2 from my github on its own 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:** [13 June 2022 12:22 UTC](https://discourse.nodered.org/t/adding-an-external-github-module-to-a-function-node/61275/5 "2022-06-13T12:22:22Z")

</div>

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